Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BUG: put null on string variable remember previous put
Message
De
08/04/2004 04:13:34
Gerry Schmitz
GHS Automation Inc.
Calgary, Alberta, Canada
 
 
À
08/04/2004 02:24:34
Walter Meester
HoogkarspelPays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00892851
Message ID:
00893203
Vues:
35
The author of "Inside SQL Server", who is/was a key person on the Server development team, advises to avoid NULLs if at all possible. As I migrate my app to SQL Server, I see this as another reason to take his advise ...

Ever load a NULL into the ControlSource of a TextBox ? Don't ... because the field becomes inaccessable; ie. you can't type over / into it. It won't even focus. Useless in a data entry situation where one is trying to "update" a null field.

>Hi Fabio,
>
>Very good repro code!! Strange things happen in VFP. This same problem seems to be in there since VFP6 or before.
>
>You must do advanced things within VFP since you're cathing a lot of bugs here. Maybe you should ask the VFPT to be an early beta tester. I could not imagine a better person for the job.
>
>Walter,
>
>
>
>
>
>>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
>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform