Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Long numbers problem
#1
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 ...
have the simplest tastes of the World : I satisfy myself with the best !

http://ToufQb.free.fr
Reply
#2
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.
Reply
#3
much longer than an INTEGER
have the simplest tastes of the World : I satisfy myself with the best !

http://ToufQb.free.fr
Reply
#4
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
Reply
#5
But I didn't understand .... but it seems to be the answer I want !
Can you totaly describe the code please ?
have the simplest tastes of the World : I satisfy myself with the best !

http://ToufQb.free.fr
Reply
#6
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.
Reply
#7
I want to make some calculations with very long NUMBERS
have the simplest tastes of the World : I satisfy myself with the best !

http://ToufQb.free.fr
Reply
#8
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.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#9
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
Reply
#10
absolutly not !

But I mean numbers with thousand figures !
have the simplest tastes of the World : I satisfy myself with the best !

http://ToufQb.free.fr
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)