Hi there,
Thanks for the replies on my earlier question. It helped a lot.
As you can see below.
The "XY Coord DIM" workes fine now.
However!!!!!!! Only with small INDEXES like 30 (=900 char)
Now I want to print a whole sheet of paper with all the characters
in the "XY Coord DIM". Thats about 9000 characters.
BUT when I made DIM textlist(80, 80). (= 6400 char)
instead of textlist(30, 30) it said "OUT OF RANGE" or
"OUT OF STRINGSPACE"
I tried to make subroutines (See code below) but that didn't help.
I thought.... Quote;"Valid index values range from -32,768 to 32,767."
SO how can I make the array smaller.!
I mean what's the problem there anyway!
:-(
Thanks
Marco
CLS
' NOTE: There are ONLY TWO TEXTBLOCKS NR 2, NR 3!!!
'--------------------DATA-----------------------------------------
tekst2$ = "Aufwiedersehen"
'Text two
tekst3$ = "ALOHAAA"
'Text three
DIM SHARED textlist(1 TO 81, 1 TO 81) AS STRING ' init 2D
array textlist
yy% = 0 ' y variable in "leegtevullen"
subroutine
yyy% = 0 ' y variable in "printlist"
subroutine
xtekst2% = 15 ' starting X coord of text two
ytekst2% = 2 ' starting Y coord of text two
kolomlengte2% = 6 ' the width of the text block
(>6...= return)
xtekst3% = 3 ' starting X coord of text three
ytekst3% = 1 ' starting Y coord of text three
kolomlengte3% = 5 ' the width of the text block
(>5...= return)
uu% = 0 ' variable used in subroutine
"vultext2" for MID$....
udrie% = 0 ' variable used in subroutine
"vultext3" for MID$....
'---------------------METHODS----------------------------------
FOR k% = 0 TO 6399 ' Giving all the X,Y coord a "."
character
???GOSUB leegtevullen
NEXT k%
tekst2: 'Locating the X,Y coor of text two +
FOR x2% = 1 TO 80 ' giving the X,Y the right char of text
two
????????GOSUB vultext2 ' see subroutine "vultext2"
NEXT x2%
tekst3: ' Same for text three as text two
FOR xdrie% = 1 TO 80
????????GOSUB vultext3
NEXT xdrie%
FOR i% = 1 TO 6399 'Put all the all the values of textlist
???????GOSUB printlist ' together and print them in a $
variable
NEXT i% ' called "totaaltext$"
PRINT totaaltext$;
END
'----------------------SUBROUTINES-----------------
leegtevullen:
????????yy% = yy%
????????xx% = xx% + 1
????????m = k% MOD 80
????????IF m = 0 THEN
????????xx% = 1
????????yy% = yy% + 1
????????END IF
???????'**************HERE IT SAYS "OUT OF**************
?textlist(yy%, xx%) = "." '****** STRINGSPACE"*********
RETURN
vultext2:
teller2% = x2% + (kolomlengte2% - 1)
B = teller2% MOD kolomlengte2%
IF B = 0 THEN
xtekst2new% = xtekst2%
ytekst2new% = (ytekst2% + (teller2% / kolomlengte2%)) - 1
ELSE
xtekst2new% = xtekst2new% + 1
ytekst2new% = ytekst2new%
END IF
uu% = (uu% + 1)
textlist(ytekst2new%, xtekst2new%) = MID$(tekst2$, uu%, 1)
RETURN
vultext3:
tellerdrie% = xdrie% + (kolomlengte3% - 1)
bb = tellerdrie% MOD kolomlengte3%
IF bb = 0 THEN
xtekst3new% = xtekst3%
ytekst3new% = (ytekst3% + (tellerdrie% / kolomlengte3%)) - 1
ELSE
xtekst3new% = xtekst3new% + 1
ytekst3new% = ytekst3new%
END IF
udrie% = (udrie% + 1)
textlist(ytekst3new%, xtekst3new%) = MID$(tekst3$, udrie%, 1)
RETURN
printlist:
yyy% = yyy%
xxx% = xxx% + 1
n = i% MOD 80
IF n = 0 THEN
xxx% = 1
yyy% = yyy% + 1
END IF
totaaltext$ = totaaltext$ + textlist(yyy%, xxx%)
RETURN