Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG: put null on string variable remember previous put
Message
From
07/04/2004 06:47:46
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
BUG: put null on string variable remember previous put
Miscellaneous
Thread ID:
00892851
Message ID:
00892851
Views:
68
You want to make to come badly to your head?

Run next:
NoBug1()
Bug1()
TryToRemoveBug1()

PROCEDURE NoBug1
LOCAL X,Y
Y = 'AAA'
X = 'AAAA'
X = .NULL.
? CTOBIN(m.X)
Y = .NULL.
? CTOBIN(m.Y)
ENDPROC

PROCEDURE Bug1
LOCAL X,Y
X = 'AAAA'
Y = 'AAA'	&& this string is 3 lenght, a bad lenght for CTOBIN
X = .NULL.      && X is filled with a null string with lenght = 3
? CTOBIN(m.X)   && <== error
Y = .NULL.	&& Y is filled with a null string with lenght = 3
? CTOBIN(m.Y)   && <== error
ENDPROC

PROCEDURE TryToRemoveBug1
LOCAL X,Y,Z
X = 'AAAA'
Y = 'AAA'	  && this string is 3 lenght, a bad lenght for CTOBIN
X = .NULL.        && X is filled with a null string with lenght = 3
? CTOBIN(m.X)     && <== error
Y = .NULL.	  && X is filled with a null string with lenght = 3
? CTOBIN(m.Y)     && <== error
X = 'S'		  && 1 is good for CTOBIN, this remove the bug ? No
Y = .NULL.	  && i think this operation is ignored because Y is NULL
? CTOBIN(m.Y)     && <== error
Y = 'AAA'	  && this string is 3 lenght, a bad lenght for CTOBIN
X = 'S'		  && 1 is good for CTOBIN, this remove the bug ? Yes
Y = .NULL.	  && Y is filled with a null string with lenght = 1
? CTOBIN(m.Y)     && <== no error
ENDPROC
Next
Reply
Map
View

Click here to load this message in the networking platform