Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VarChar ?
Message
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Title:
Miscellaneous
Thread ID:
00922385
Message ID:
00922825
Views:
13
Thank you Sergy - the example explains it well. Would you happen to know, other than eliminating the need to trim, if there is a a performance advantage of one field type over another?


>>So whats the diff between a varchar DBF field and a char DBF field?
>
>Hi Terry,
>
>Keep in mind that VFP doesn't automatically trimes trailing spaces in a value stored in a varchar field. It's up to programmer/program to do that. There''s no difference beteween them if trailing spaces for varchar wasn't removed. VFP would take into account only actual value stored in a varchar field (with or w/o spaces) not the whole size of the field. For example,
>lcStr2 = f01
>CREATE CURSOR test (v01 varchar (20), f01 char (20))
>INSERT INTO test VALUES("ABC", "ABC")
>lcStr1 = v01
>? LEN(lcStr1), LEN(v01)
>lcStr2 = f01
>? LEN(lcStr2), LEN(vf01)
>? v01 == "ABC"             && .T.
>? f01 == "ABC"             && .F.
>
Imagination is more important than knowledge
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform