Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Qbasics for Windows
#6
Opresion:

A few remarks are in order.

First, to test the maximum value of x for a three-dimensioned array in QuickBASIC (QB), I wrote a simple program, which consists of the first five lines of the code below.

When the program is run, I find that the value of i where the array fails is 20, making ARRAY(19,19,19) the maximum array for the stated conditions.

Next, since you are looking for large, three-dimension arrays in QB, and that is not possible, to my knowledge, beyond the above dimension 19, I propose the use of multiple such arrays.  And, to illustrate this, I came up with the following QB program.  Comments?:

Code:
GOTO START:

'Array.bas creates two, 3-dimensional arrays of dimension (19,19,19), which
'is the maximum size of 3-dimension array I could create in my QB4.5, using
'the following code, before it produces a "Subscript out of range" message:
FOR i = 1 TO 100
  REDIM array(i, i, i)
  PRINT i
NEXT i
STOP


START:
'ARRAY.BAS, by Ralph A. Esquivel, 01/09/08, shows how to use two arrays and,
'by extrapolating the program, a large number of such arrays.

CLS
x = 19 'array size to use is (x,x,x), which allows:
'1*6,859 =  6,859 elements for one array
'2*6,859 = 13,718 elemens for two arrays
'etc.

DIM array1(x, x, x) AS DOUBLE
  FOR i = 1 TO x
    FOR j = 1 TO x
      FOR k = 1 TO x
        a = a + 1
        array1(i, j, k) = a
        PRINT array1(i, j, k);
      NEXT k
    NEXT j
  NEXT i
STOP

DIM array2(x, x, x) AS DOUBLE
  FOR i = 1 TO x
    FOR j = 1 TO x
      FOR k = 1 TO x
        a = a + 1
        array2(i, j, k) = a
        PRINT array2(i, j, k);
      NEXT k
    NEXT j
  NEXT i
STOP



Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply


Messages In This Thread
Qbasics for Windows - by Opresion - 09-19-2007, 04:49 PM
Re: Qbasics for Windows - by Opresion - 09-19-2007, 05:05 PM
Re: Qbasics for Windows - by Opresion - 09-19-2007, 05:09 PM
Qbasics for Windows - by Opresion - 09-19-2007, 05:13 PM
The Qbasics for Windows - by Opresion - 10-01-2007, 04:13 PM
Re: Qbasics for Windows - by Ralph - 01-10-2008, 09:56 AM
Re: Qbasics for Windows - by Ralph - 01-13-2008, 12:29 AM
Qbasics for Windows - by Opresion - 01-30-2008, 05:13 PM
Re: Qbasics for Windows - by Ralph - 01-31-2008, 06:58 AM
Qbasics for Windows - by Opresion - 02-01-2008, 01:05 PM
Re: Qbasics for Windows - by Ralph - 02-02-2008, 04:50 AM
Re: Qbasics for Windows - by Ralph - 02-02-2008, 10:40 AM
Re: Qbasics for Windows - by Opresion - 02-06-2008, 12:35 PM
Qbasics for Windows - by Opresion - 02-06-2008, 12:46 PM
Re: Qbasics for Windows - by Ralph - 02-07-2008, 02:48 AM
QBasics for Windows - by Opresion - 02-08-2008, 12:29 PM
Re: Qbasics for Windows - by Ralph - 02-09-2008, 07:31 AM
Qbasics for Windows - by Opresion - 02-17-2008, 02:32 PM
Re: Qbasics for Windows - by Ralph - 02-18-2008, 07:50 AM
Qbasics for Windows - by Opresion - 02-18-2008, 12:19 PM
Re: Qbasics for Windows - by Ralph - 02-19-2008, 07:48 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)