bug in TIP library

Moderator: Rathinagiri

Post Reply
User avatar
Alex Gustow
Posts: 290
Joined: Thu Dec 04, 2008 1:05 pm
Location: Yekaterinburg, Russia
Contact:

bug in TIP library

Post by Alex Gustow » Wed Nov 18, 2009 1:27 pm

Sorry, Roberto - it's not a MiniGUI bug. But can you please send it to "Harbour Bugreport"?

TIP library
MAIL.PRG (my version: 16.10.2009 06:59)

METHOD FromString( cMail, cBoundary, nPos ) CLASS TipMail

Line 391

Code: Select all

nLinePos := hb_At( e"\r\n", cMail, nPos )
It produces runtime error (of course - error exists in 1st parameter! it must be - I think - simple "\r\n")

For example of "correct" hb_At() calling - line 403:

Code: Select all

nSplitPos := hb_At( ":", cMail, nPos )
10 minutes later...

Right now I went to Harbour CVS on Sourceforge.
source\tip\mail.prg
Revision 1.8 - (download) (annotate)
Thu Sep 24 19:09:20 2009 UTC (7 weeks, 5 days ago) by lculik
Here - this bug in line 404, and "correct calling of hb_At() at line 417.

User avatar
Roberto Lopez
HMG Founder
Posts: 3897
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 132 times

Post by Roberto Lopez » Thu Nov 19, 2009 3:05 am

Alex Gustow wrote:Sorry, Roberto - it's not a MiniGUI bug. But can you please send it to "Harbour Bugreport"?

TIP library
MAIL.PRG (my version: 16.10.2009 06:59)

METHOD FromString( cMail, cBoundary, nPos ) CLASS TipMail

Line 391

Code: Select all

nLinePos := hb_At( e"\r\n", cMail, nPos )
It produces runtime error (of course - error exists in 1st parameter! it must be - I think - simple "\r\n")

For example of "correct" hb_At() calling - line 403:

Code: Select all

nSplitPos := hb_At( ":", cMail, nPos )
10 minutes later...

Right now I went to Harbour CVS on Sourceforge.
source\tip\mail.prg
Revision 1.8 - (download) (annotate)
Thu Sep 24 19:09:20 2009 UTC (7 weeks, 5 days ago) by lculik
Here - this bug in line 404, and "correct calling of hb_At() at line 417.
Thanks Alex. I'll do it ASAP.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Alex Gustow
Posts: 290
Joined: Thu Dec 04, 2008 1:05 pm
Location: Yekaterinburg, Russia
Contact:

Post by Alex Gustow » Thu Nov 19, 2009 11:09 am

Roberto, hi again!

I was stupid :) when I wrote previous post (about "error! of course!..").

Only now I looked at (x)Harbour.chm (help; Grigory bundled it into HMG Ext. package - I don't know is it exists into HMG Original package), to "Overview" - "Build-in data types" and read text:

Code: Select all

Literal (static) representation of scalar types:
...
String "String", 'String', [String], or E"String\n"
Uuuumm... :( It's not a really bug - but I'm a fool :(

BTW, Grigory wrote (in Russian Clipper/Harbour/GUI forum) that all methods from TIP.LIB works correctly - if you use xHarbour...

Now I try to understand differences between "how it works" (methods etc. from TIP.LIB) with Harbour and with xHarbour. I wann't migrate from Harbour to xHarbour only for creating one application... I try to understand "what I need to correct into my code to have app with mail-related functions using Harbour (nor xHarbour)?"... Maybe results of my researches will be useful for community.

P.S. I registered today on XHDN (I thought I can find any information about TIP.LIB). I looked to Online Reference... No descriptions (for classes from TIP.LIB), no examples - only list of properties and methods for each class and nothing more... :( So I decide to write my "TIP Library Manual" ASAP. :)

User avatar
Rathinagiri
Posts: 5149
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 124 times
Been thanked: 126 times
Contact:

Post by Rathinagiri » Thu Nov 19, 2009 11:33 am

So I decide to write my "TIP Library Manual" ASAP.

Good decision. :) I am awaiting for the same.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
Roberto Lopez
HMG Founder
Posts: 3897
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 132 times

Post by Roberto Lopez » Thu Nov 19, 2009 1:17 pm

Alex Gustow wrote:Roberto, hi again!

I was stupid :) when I wrote previous post (about "error! of course!..").
Ok.

Just for curiosity... what the 'E' mean?
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Alex Gustow
Posts: 290
Joined: Thu Dec 04, 2008 1:05 pm
Location: Yekaterinburg, Russia
Contact:

Post by Alex Gustow » Thu Nov 19, 2009 1:47 pm

Look at this (borrowed from MAIL.PRG in HBTIP sources you posted here few days ago - do you remember?):

Code: Select all

( from "METHOD ToString()" )
   // Begin output the fields
   // Presenting them in a "well-known" order
   IF "Return-Path" $ ::hHeaders
      cRet += "Return-Path: " + ::hHeaders[ "Return-Path" ] + e"\r\n"
   ENDIF
I think - it's for (x)Harbour compatability with C syntax (or for C-programmers, who want to write on (x)Harbour easier): e"\r\n" equal chr(13)+chr(10) . I think so... but maybe I'm stupid again :)

User avatar
Roberto Lopez
HMG Founder
Posts: 3897
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 132 times

Post by Roberto Lopez » Thu Nov 19, 2009 3:37 pm

Alex Gustow wrote:Look at this (borrowed from MAIL.PRG in HBTIP sources you posted here few days ago - do you remember?):

Code: Select all

( from "METHOD ToString()" )
   // Begin output the fields
   // Presenting them in a "well-known" order
   IF "Return-Path" $ ::hHeaders
      cRet += "Return-Path: " + ::hHeaders[ "Return-Path" ] + e"\r\n"
   ENDIF
I think - it's for (x)Harbour compatability with C syntax (or for C-programmers, who want to write on (x)Harbour easier): e"\r\n" equal chr(13)+chr(10) . I think so... but maybe I'm stupid again :)
I guess that you are right (on the first thing :) ). Perhaps the 'e' stands for 'escape sequence' to use c-style strings.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Alex Gustow
Posts: 290
Joined: Thu Dec 04, 2008 1:05 pm
Location: Yekaterinburg, Russia
Contact:

Post by Alex Gustow » Thu Nov 19, 2009 8:44 pm

Roberto Lopez wrote:Perhaps the 'e' stands for 'escape sequence' to use c-styñe strings.
Maybe. I don't know (I'm not a good C-man; most likely - "zero" one :) ). But now I know: it works. And now I understand "what it means". :)

I enlarged my knowledge about mail manipulating last 2 days. Report & manual coming soon...

And - right now Masha stays near me (after visiting WC :) ) and said: "Hi Roberto and all here!" :)

It's Masha!
Hello everybody!!! ;-> Now I'm sitting at the father's comp and I'm going to sleep so good night to you, best wishes, etc.! ;-> (I'm not already here, so if you want to ansver me, I'll read it only tomorrow!)

It's Alex again. Uffffffff...
SHE TURNED ME OFF MY CHAIR AT THE COMP!!! :0 :) :)

Sorry for little offtopic :)

Post Reply