• 0 Vote(s) - 0 Average
• 1
• 2
• 3
• 4
• 5
 Qbasics for Windows Ralph Senior Member Posts: 544 Threads: 27 Joined: Jan 2005 01-10-2008, 09:56 AM (This post was last modified: 01-10-2008, 09:59 AM by Ralph.) 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. « Next Oldest | Next Newest »

 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)