![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
According to the VFP 9 docs under "Visual FoxPro System Capacities", the maximum string length is 16777184. What is the true maximum, and where is it documented? Adding characters ten at a time, I created a string of 40 million characters. If I start with one character and double, I get an error 1903 (String is too long to fit.) after 16777216 (2^24). (This is odd since twice that is less than 40 million.) If I start with one character and double up to 16777216, then add 1 MB at a time, I get an error 43 (There is not enough memory to complete this operation.) after 383778816 (over 1/3 GB). Since it is possible to create some very long strings and yet get errors on shorter strings, what are the rules for l-o--n---g strings? If you want a garantee the refer to the length of the docs. |
#3
| |||
| |||
|
#4
| ||||
| ||||
|
|
with less than 16 MB strings you are on the sure side. You can also create longer strings at once eg via FILETOSTR() or SPACE(). |
|
I've read somewhere, that some operations can fail on longer strings. Others are only limited by the amount of RAM. But don't know which operations. From what you say, the + operator is even in both classes of operations: it works in some cases and not in other cases. |
|
Nevertheless I think the fast string functions like in- string-search of VFP are optimized for table fields, which can only be 254 characters long, despite of memo fields. There are different more complex algorithms, which are faster for longer strings, eg the foxpro AT() can be outperformed by Boyer-Moore algorithm for string searches - at least I did so in some special case, but that algorithm does some precalculation which - although it's not that complex - can make it slower for short strings. |
|
I'd even cut longer strings into small portions of say 8 to 16 KB and work on them in VFP or do some special FLL/DLL for manipulation of longer strings (I'm thinking about longer than 16MB here) or files. Mostly those longer strings are files, aren't they? |
#5
| |||
| |||
|
|
In my case, they will be report pages. I had thought to put the whole report in one page, so I was concerned about maximum length. I decided to go to a string per page as with that, I can output to a string array and have another array with the page orientation. See? Another rabid analyst tears a long string to pieces. |
![]() |
| Thread Tools | |
| Display Modes | |
| |