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"
>? f01 == "ABC"
>
Imagination is more important than knowledge