Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with ATC()?
Message
De
16/01/2002 17:03:13
Charles Richard
Nvo Management Systems
Boisbriand, Québec, Canada
 
 
À
29/08/2001 16:04:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00550537
Message ID:
00605756
Vues:
11
Jim - it's been a long time since you posted this, but I would be interested in your comments as I have run into the same problem. If you want, have a look at Thread #605723 Message #605723

Have a nice day


>I've been struggling since 1100am today on this...
>
>Please excuse the present state of the code, but it is this way after many attempted variations.
>
>Until 10 minutes ago I was using the following:
>
m.X3 = ATC(m.OnlyWords,  ;
>          SUBSTR(This.MessageContent[This.MessageDetail[m.X2,1]],  ;
>                 This.MessageDetail[m.X2, 4],  ;    && paragraph start
>                 This.MessageDetail[m.X2, 5]), 1)   && paragraph length
>
>The above ATC() returned a non-zero value in the first pass, for a string of 210 characters, but ALWAYS returned 0 for a string (that happened to be) of 672 characters.
>
>Finally I gave up and tried an alternative, as follows:
>
IF SUBSTR(This.MessageContent[This.MessageDetail[m.X2,1]],  ;
>          This.MessageDetail[m.X2, 4]+This.MessageDetail[m.X2, 8],  ;    && paragraph start
>          This.MessageDetail[m.X2, 5]-This.MessageDetail[m.X2, 8])  ;    && paragraph end
>     <> m.OnlyWords
>ENDIF
>
>This returned .F., indicating that the two comparands were equal!
>I put the m.OnlyWords varaible last because it will often be shorter than the substring extract.
>The reason for the added "+/- This.MessageDetail[m.X2, 8]" is to bypass any specific characters that might be at the start of the extracted string. In this case there were none, but subsequently there are.
>
>The reason that I used the ATC() function was to avoid having to make allowance for the specific leading characters in the extracted portion and to make the sometimes shorter m.OnlyWords findable even if the other is longer.
>
>I will get along with the comparison now, but feel that there is a bug in ATC(). Anyone know if there is?
>
>PS I Put this in VFP7 topic but the ATC() performed exactly the same in VFP6.
>
>JimN
Charles Richard
NVO Management Systems
crichard@nvo.ca
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform