|
- Forum - iziBasic
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257
Sujet n° 1652 |
Extention of Arrays |
le 11/09/2009 @ 22:37 par Roy sommers
|
The program Dim2.iBas showed how to achieve 2 dim arrays from A().Basically one replaces A(I,J) by A(w) where w=30+J+I*Jmax.Looking it as a matrix this stacks rows. Therefore, this can be extended into two arrays A(I,J) and B(K,L) where the B rows are stacked at the end of the A components by using B(x) where x=30+ Imax*Jmax+ L + K*Lmax. My question is how much room is available in A()? I don't know who wrote Dim2 but it's clever. |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 1 -------- le 12/09/2009 @ 01:12 par aldweb
visiteur |
Hello Roy,
I am the one who wrote Dim2 This is only a well known trick. Since computer memory is linear, whatever variables construction you design, you have to bring it back to a linear setting.
The room available in A() depends of the OS version of your device, as set with the MINOSVERSION compiling directive (see page 14 of the latest version 7.0 of the user manual).
Cheers, aldweb |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 2 -------- le 12/09/2009 @ 04:10 par Roy Sommers
visiteur |
Hi: In case someone wants to use the case of A(I,J) with B(K,L), where I wrote B(x) it should have been A(x). All of the storage is in A(). I have checked out the two matrix case in a program. Thanks, Roy |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 3 -------- le 17/09/2009 @ 17:51 par Roy Sommers
visiteur |
To clarify extended arrays, the portion of the coding that would fill a 3 by 3 and a 2 by 4 matrix could be: For I = 1 to 3 For J = 1 to 3 INPUT" ",X V=30 + J + I * %JMAX% A(V) = X NEXT NEXT FOR K=1 TO 2 FOR L= 1 TO 4 INPUT" ",Y V= 30+L +%IMAX% * %JMAX% + K * %LMAX% A(V) = Y NEXT NEXT
|
|
|
sujet actif
sujet clos
Important!
Nouveau message -
Rectifier message
Clôturer sujet
Remonter
|
|