Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error with oRange
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Divers
Thread ID:
01516312
Message ID:
01516554
Vues:
27
>I worked on this program (automation) last night and already this morning and here is the code I have so far. There is other code after the ENDFOR that I am not posting. I modified the code to work with 12 tables versus cursors. I converted the cursors to Tables last night in order to minimize the processing for testing purposes only. When the program is finished it will process the data into 12 cursors, each representing a month's financial data of a certain year. My concern is that the IF statement is not working. It is:
>
>IF ALLTRIM(lcCarr_Name) != lcOldCarr_Name
>
>This statement shows up as a value of FALSE, but it should come out as TRUE, since the Carrier Name of "ACE" does not equal lcOldCarr_Name which holds a blank, as in "".
>
You need to review how VFP does comparisons on strings of unequal length, especially with SET EXACT OFF. The comparison is made up to the length of the RightHand Arguement (RHA). IF RHA is an empty string (LEN = 0 rather than all blanks) the comparison always is true.
xx = "abcd"
yy = ""
? xx = yy  && true

yy = "a"
? xx = yy  && true

yy = "ab"
? xx = yy && true.....etc
If you need to work with SET EXACT OFF then you need to take special care.
xx = "Anything"
yy = ""

? xx != yy  && false
? NOT xx == yy && true
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform