string bigger thant 64Ko
string bigger thant 64Ko
Is there anyway to use string bigger than 64Ko ???
For using replacestring, findstring....
Thank you
For using replacestring, findstring....
Thank you
Re: string bigger thant 64Ko
> Is there anyway to use string bigger than 64Ko ???
Not until (hopefully) v4.00 of PureBasic.
Not until (hopefully) v4.00 of PureBasic.
- newtheogott
- Enthusiast

- Posts: 120
- Joined: Sat Apr 26, 2003 2:52 pm
- Location: Germany, Karlsruhe
- Contact:
Strings >64k is more "up-to-date"
To use MemAlloc etc. for large Amounts of data is maybe faster, but its not "true Basic".
And its not "as simple" to work with Replace, stringfilter etc.
I also prefer to use "Longstrings" and hope Fred will provide them one day ...
As said "Longstrings" are maybe slower, also the BASIC must do the "garbage-collection". However even "Data-Exchange" with VB may get more easy then.
And speed maybe important - but speed-of-developement is for many people (with todays computers) more important.
And its not "as simple" to work with Replace, stringfilter etc.
I also prefer to use "Longstrings" and hope Fred will provide them one day ...
As said "Longstrings" are maybe slower, also the BASIC must do the "garbage-collection". However even "Data-Exchange" with VB may get more easy then.
And speed maybe important - but speed-of-developement is for many people (with todays computers) more important.
--Theo Gottwald
-----------------------------------------
http://www.it-berater.org * http://www.fa2.de * http://www.smart-package.com
-----------------------------------------
http://www.it-berater.org * http://www.fa2.de * http://www.smart-package.com
Which gives me an idea... Wouldn't it be cool if the string commands could also be used with memory banks, like CompareMemoryString()? Maybe with a 'Use Memory' switch? 
There may come a day when I'll need a >64k string, but so far I've substituted memory banks with no problems (other than some extra coding required).
Russell
There may come a day when I'll need a >64k string, but so far I've substituted memory banks with no problems (other than some extra coding required).
Russell
*** Diapers and politicians need to be changed...for the same reason! ***
*** Make every vote equal: Abolish the Electoral College ***
*** www.au.org ***
*** Make every vote equal: Abolish the Electoral College ***
*** www.au.org ***
- newtheogott
- Enthusiast

- Posts: 120
- Joined: Sat Apr 26, 2003 2:52 pm
- Location: Germany, Karlsruhe
- Contact:
Garbage Collection ...
Thats all possible, but its unconvenient and its not BASIC.
The biggest difrence aboutall that is that the "BASIC-engine" has to do the "Garbage-Collection" which is been done "manually" if you use Memory-Blocks.
However, it should already be there, should maybe just need an enhancement to 4 Byte ... (2 Byte = 65536, 4 Byte = 2 Mrd. = actual Standard of most other Languages about strings).
The biggest difrence aboutall that is that the "BASIC-engine" has to do the "Garbage-Collection" which is been done "manually" if you use Memory-Blocks.
However, it should already be there, should maybe just need an enhancement to 4 Byte ... (2 Byte = 65536, 4 Byte = 2 Mrd. = actual Standard of most other Languages about strings).
--Theo Gottwald
-----------------------------------------
http://www.it-berater.org * http://www.fa2.de * http://www.smart-package.com
-----------------------------------------
http://www.it-berater.org * http://www.fa2.de * http://www.smart-package.com
Does a string variable in PB hold the actual zero-terminated string or is it an address pointer TO the actual string data? I'm guessing that it's the first one, because otherwise I can't imagine why there would be a 64k limit (a long pointer can point to anywhere in memory, below 2Gb <4Gb if you have unsigned longs>
). I guess fixed-length strings could be stored at the address of the variable, but variable length/dynamic strings would be a pain to keep track of if their lengths could change (anything stored 'behind' it would have to be moved, etc).
Russell
Russell
*** Diapers and politicians need to be changed...for the same reason! ***
*** Make every vote equal: Abolish the Electoral College ***
*** www.au.org ***
*** Make every vote equal: Abolish the Electoral College ***
*** www.au.org ***
- newtheogott
- Enthusiast

- Posts: 120
- Joined: Sat Apr 26, 2003 2:52 pm
- Location: Germany, Karlsruhe
- Contact:
If I understand it right we need "just" a new libr
... with string-commands ?
That way the strings WOULD already be "longstrings" only the commands cannot handle them in "full length".
That way the strings WOULD already be "longstrings" only the commands cannot handle them in "full length".
--Theo Gottwald
-----------------------------------------
http://www.it-berater.org * http://www.fa2.de * http://www.smart-package.com
-----------------------------------------
http://www.it-berater.org * http://www.fa2.de * http://www.smart-package.com
Code: Select all
a.s = "Hello "
a + "World"this buffer.
Timo
quidquid Latine dictum sit altum videtur
- newtheogott
- Enthusiast

- Posts: 120
- Joined: Sat Apr 26, 2003 2:52 pm
- Location: Germany, Karlsruhe
- Contact:
I guess this system saves time while garbage collection ?
I guess this system saves time while garbage collection ?
A fixed buffer which does not need pre-allocation ?
Therefore string-operations with the current system (and its limitations) should be faster then with other systems.
Otherwise I may ask myself why other languages like VB do not seem to use then a "non-fixed-size" temp-buffer.
However I would love to see that one day for PB too.
What you write makes hope that its not sooo much to change.
A fixed buffer which does not need pre-allocation ?
Therefore string-operations with the current system (and its limitations) should be faster then with other systems.
Otherwise I may ask myself why other languages like VB do not seem to use then a "non-fixed-size" temp-buffer.
However I would love to see that one day for PB too.
What you write makes hope that its not sooo much to change.
--Theo Gottwald
-----------------------------------------
http://www.it-berater.org * http://www.fa2.de * http://www.smart-package.com
-----------------------------------------
http://www.it-berater.org * http://www.fa2.de * http://www.smart-package.com
How about a command 'SetStringBufferSize(size in bytes)' before any string commands are used to change the size of the internal buffer? I'm guessing that this would not be as easy as it sounds to implement...
Russell
Russell
*** Diapers and politicians need to be changed...for the same reason! ***
*** Make every vote equal: Abolish the Electoral College ***
*** www.au.org ***
*** Make every vote equal: Abolish the Electoral College ***
*** www.au.org ***

