# 2D Array Problem

## Recommended Posts

Hello,

I am trying to do the following:

Take values in two defined array

\$array1[8]

\$array2[255]

Where

\$array1[0] = 0

\$array1[1] = 32

\$array1[2] = 64

\$array1[3] = 96

\$array1[4] = 128

\$array1[5] = 160

\$array1[6] = 192

\$array1[7] = 224

And

\$array2[255] = 1 through 255

And loop those values to do the following:

FileWrite (\$FILE, 0.0)

FileWrite (\$FILE, 0.32)

FileWrite (\$FILE, 0.64)

until its done with \$array1 and does

FileWrite (\$File, 1.0)

FileWrite (\$File, 1.32)

FileWrite (\$File, 1.64)

So on and so forth all the way through 255 for \$array2

Any help is very much appreciated

Also if there was a way to concantante those values and store to one array that would be the cats meow :-)

Thank You!

Edited by ScriptCrafter

##### Share on other sites

Hi,

```Dim \$array1[8], \$array2[256]
;\$array1[0] = 0
;\$array1[1] = 32
;\$array1[2] = 64
;\$array1[3] = 96
;\$array1[4] = 128
;\$array1[5] = 160
;\$array1[6] = 192
;\$array1[7] = 224

\$count = 0
For \$i = 0 To 224 Step 32
\$array1 [\$count] = \$i
\$count += 1
Next

For \$i = 0 To 255
\$array2 [\$i] = \$i
Next

\$FILE = FileOpen ("c:\testlog.txt", 1)

For \$i = 0 To UBound (\$array2) - 1
For \$j = 0 To UBound (\$array1) - 1
FileWriteLine (\$FILE, \$array2 [\$i] & "." & \$array1 [\$j])
Next
Next
FileClose (\$FILE)

;-))

Stefan

Edit: Add automatic creation of arrays.

Edited by 99ojo

## Create an account

Register a new account