Microsoft KB Archive/133740

= Null Value (.NULL.) Is a Marker - Not a Data Type =

Article ID: 133740

Article Last Modified on 2/15/2000

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition

-



This article was previously published under Q133740



SUMMARY
The null value (.NULL.) is not an actual value, it is a marker that denotes that a memory variable or a field value is missing or unknown. If .NULL. is assigned to a field or a variable, the field or variable's data type is not changed, but the value is changed to NULL.



Steps to Demonstration Behavior
The .NULL. value can be assigned to variables that are numeric or character as demonstrated by these steps:

  From the Command window, issue these commands: nMyvariable=200       && and press ENTER ? TYPE("nMyvariable") && and press ENTER ? nMyvariable The N is displayed for nMyvariable denoting a variable of numeric type.   To assign a null value (.NULL.) to nMyvariable, issue the following commands in the Command window: store .NULL. to nMyvariable       && and press ENTER ? TYPE("nMyvariable")             && and press ENTER ? nMyvariable                     && and press ENTER The value N is displayed followed by .NULL.; the type of the variable did not change but the value did.   To assign a character string to the variable and check the variable type, issue the following commands in the Command window: cMyvariable="This is a String"    && and press ENTER ? cMyvariable                     && and press ENTER The screen displays the string "This is a String."   Issue the following command in the Command window: ? TYPE("cMyvariable")             && and press ENTER The screen displays C denoting a character type.   Issue the following commands in the Command window: STORE .NULL. TO cMyvariable       && and press ENTER ?TYPE("cMyvariable")              && and press ENTER The screen displays C to show that the type has not been changed. 

Additional query words: VFoxWin

Keywords: KB133740

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.