Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VarChar ?
Message
From
09/07/2004 16:15:06
 
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Title:
Miscellaneous
Thread ID:
00922385
Message ID:
00922707
Views:
21
Terry,

>>You see the difference when you make use of the fields and don't have to TRIM, for instance.
>
>Ahhhh ... Thank you!

To illustrate, with Char(10) and VarChar(10) containing "1234":
? MyChar+"|"   && 1234      |
? MyVarC+"|"   && 1234|
Actually, there is a difference in the way they are stored in the DBF. They occupy the same space but the last character in the field is different for VarChar (if the value is shorter than the field length). In that case, it contains a hex for the actual length of the value.

For example, Char(10) and VarChar(10) in a table, put value "1234" in each. Open the DBF with MODI FILE and check the 10th character of each. The VarChar will have CHR(4) in the 10th character.
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform