Posts: 57
Threads: 12
Joined: Mar 2003
Does anyone know how can I use "very" long strings ...
I mean that the LONG type variable is not enough !!
In fact , I would like to use number bigger than 32635 ...
Posts: 704
Threads: 0
Joined: Dec 2002
much larger than that. (That number isn't even at the limit of a short INTEGER.)
ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
Posts: 57
Threads: 12
Joined: Mar 2003
much longer than an INTEGER
Posts: 440
Threads: 65
Joined: Sep 2001
I may not understand what you're asking. If so, I am sorry...
Do you mean you want to get and use a string larger than 32k?
The 32k limit can be overcome by setting up a double buffer to use a 64k string. Something like...
Code:
TYPE DoubleBuffer
B1 AS STRING * 32000
B2 AS STRING * 32000
END TYPE
'$DYNAMIC
'make the 64k buffer...
DIM SHARED BigBuffer(0) AS DoubleBuffer
'...
'Grab 64k...
GET #1, , BigBuffer(0)
Now, if you want to use/change the string data in the BigBuffer, you have to use PEEK/POKE to do it, which makes it slow to really do anything very intense.
Code:
DEF SEG = VARSEG(BigBuffer(0))
'To show the first 10 characters in the string...
FOR t = 0 TO 9
PRINT CHR$(PEEK(t))
NEXT
- Dav
Posts: 57
Threads: 12
Joined: Mar 2003
But I didn't understand .... but it seems to be the answer I want !
Can you totaly describe the code please ?
Posts: 480
Threads: 24
Joined: Mar 2003
I'm not sure I understand the question. Are you looking to make a long STRING or a long NUMBER? What kind of data are you storing in the variable, and what's it being used for?
*peace*
Meg.
Posts: 57
Threads: 12
Joined: Mar 2003
I want to make some calculations with very long NUMBERS
Posts: 6,419
Threads: 74
Joined: Mar 2002
How long? Try using LONGs
Code:
DIM a AS LONG
DIM b AS LONG
a = 67655453: b = 987898432
PRINT a + b
If they are not big enough, use Neo's routines.
Posts: 1,407
Threads: 117
Joined: Dec 2002
Are you trying to win your own prime contest? :rotfl:
Se the projects section, Neo announced recently there the release of his BIGINT library.
Antoni
Posts: 57
Threads: 12
Joined: Mar 2003
absolutly not !
But I mean numbers with thousand figures !