Re: limitation on string of 255 bytes??? by Fred
Fred
Fri Jul 11 18:39:21 CDT 2008
Character field limits are 254, string constants are 255, and string
variables are 16,777,184 (VFP9). The discussion has been about all three at
one point or another.
--
Fred
Microsoft Visual FoxPro MVP
"Lew" <lew@fastmail.fm> wrote in message
news:%23D3Rmx64IHA.3480@TK2MSFTNGP03.phx.gbl...
>I thought this discussion was about string lengths not field widths. Was I
>wrong?
> "Bernhard Sander" <fuchs@no.spam> wrote in message
> news:eP4oQnz4IHA.5012@TK2MSFTNGP02.phx.gbl...
>> Hi Lew,
>>
>>> It's probably a pascal string type (which you can use in c). The first
>>> byte tells the string length (leaving a max of 254 for the rest of the
>>> string). This is unlike c type strings that are of indefinite length,
>>> but terminate in chr(0).
>> >
>>> "Gene Wirchenko" wrote:
>>>
>>>> "Fred Taylor" <ftaylor@mvps.org!REMOVE> wrote:
>>>>
>>>>> As which, the constant size or the maximum string size? Maybe in
>>>>> dBase][ it was 1K for maximum size, but constants have always been 255
>>>>> from what I can recall.
>>>> Oddly, columns are limited to c(254). IIRC, this dates from
>>>> dBASE II. I do not remember if strings were similarly limited.
>>>>
>>>> 254 is weird.
>>>>
>> A dBase character field always has a fixed length, also called field
>> width, no matter how many bytes you store in it. The field is always
>> filled up with blanks. The field width is stored in the table header.
>>
>> It is a little different with varchar fields of foxpro. There the actual
>> length is stored in the last byte of the field, but only if it is not
>> completely filled. There is a special bit in an extra, invisible system
>> column which indicates, whether the varchar field is completely filled or
>> not.
>>
>> But in dBase II there weren't varchar fields
>>
>> Regards
>> Bernhard Sander
>
>