Jump to content

_ArrayInsert with Multidimensional array


Recommended Posts

I am trying to add variable values into a multidimensional array. I am a real big noob to AutoIT, but have other scripting languages experience.

I keep getting a syntax error on compile.

I tried several things to no avail.

Help

<part of my code. all variables are set already. )

snippet of code.

Global $ArrayGrid_Queue [100] [9]

Global $ArrayGrid_QueueRowCount = 1 ; This is where the jobs should now get inserted into the array.

<...>

_ArrayInsert ($ArrayGrid_Queue, [$ArrayGrid_QueueRowCount] [0], $JobNumber) ; JobNumber

_ArrayInsert ($ArrayGrid_Queue, [$ArrayGrid_QueueRowCount] [1], $Array_JobNumberCurrentStatus[1]) ; JobNumber current Status.

_ArrayInsert ($ArrayGrid_Queue, [$ArrayGrid_QueueRowCount] [2], $InputNumberOfCopies) ; Number of Copies to Burn.

_ArrayInsert ($ArrayGrid_Queue, [$ArrayGrid_QueueRowCount] [3], $File2Add2QueueImage) ; "ISO/Image File Name"

_ArrayInsert ($ArrayGrid_Queue, [$ArrayGrid_QueueRowCount] [4], $File2Add2QueueCover) ; "Cover File Name"

_ArrayInsert ($ArrayGrid_Queue, [$ArrayGrid_QueueRowCount] [5], $InputRobotNumber) ; "RobotNumber"

_ArrayInsert ($ArrayGrid_Queue, [$ArrayGrid_QueueRowCount] [6], 1 ) ; "RecorderBankNumber"

_ArrayInsert ($ArrayGrid_Queue, [$ArrayGrid_QueueRowCount] [7], $InputRecorderNumber) ; "RecorderNumber"

_ArrayInsert ($ArrayGrid_Queue, [$ArrayGrid_QueueRowCount] [8], $InputJobPriority) ; "JobPriority"

;Increment the row counter so the next job added does not overwrite this job.

$ArrayGrid_QueueRowCount = $ArrayGrid_QueueRowCount + 1

$JobNumber = $JobNumber + 1

Link to comment
Share on other sites

I am trying to add variable values into a multidimensional array. I am a real big noob to AutoIT, but have other scripting languages experience.

I keep getting a syntax error on compile.

I tried several things to no avail.

Help

<part of my code. all variables are set already. )

snippet of code.

Global $ArrayGrid_Queue [100] [9]

Global $ArrayGrid_QueueRowCount = 1 ; This is where the jobs should now get inserted into the array.

<...>

_ArrayInsert ($ArrayGrid_Queue, [$ArrayGrid_QueueRowCount] [0], $JobNumber) ; JobNumber

_ArrayInsert ($ArrayGrid_Queue, [$ArrayGrid_QueueRowCount] [1], $Array_JobNumberCurrentStatus[1]) ; JobNumber current Status.

_ArrayInsert ($ArrayGrid_Queue, [$ArrayGrid_QueueRowCount] [2], $InputNumberOfCopies) ; Number of Copies to Burn.

_ArrayInsert ($ArrayGrid_Queue, [$ArrayGrid_QueueRowCount] [3], $File2Add2QueueImage) ; "ISO/Image File Name"

_ArrayInsert ($ArrayGrid_Queue, [$ArrayGrid_QueueRowCount] [4], $File2Add2QueueCover) ; "Cover File Name"

_ArrayInsert ($ArrayGrid_Queue, [$ArrayGrid_QueueRowCount] [5], $InputRobotNumber) ; "RobotNumber"

_ArrayInsert ($ArrayGrid_Queue, [$ArrayGrid_QueueRowCount] [6], 1 ) ; "RecorderBankNumber"

_ArrayInsert ($ArrayGrid_Queue, [$ArrayGrid_QueueRowCount] [7], $InputRecorderNumber) ; "RecorderNumber"

_ArrayInsert ($ArrayGrid_Queue, [$ArrayGrid_QueueRowCount] [8], $InputJobPriority) ; "JobPriority"

;Increment the row counter so the next job added does not overwrite this job.

$ArrayGrid_QueueRowCount = $ArrayGrid_QueueRowCount + 1

$JobNumber = $JobNumber + 1

what is the specific error... what is it having problems with?

Everseeker

Link to comment
Share on other sites

I came to the conclusion that after reading this post

http://www.autoitscript.com/forum/lofivers....php?t9520.html

that I do not actually have to use the _ArrayInsert method to input my information into the array itself.

_ArrayInsert is very misleading based on the help file.

Since I have already created the multi-dimensional array with this command,

Global $ArrayGrid_Queue [100] [9]

I now have all 900 locations to be able to put values into.

My modified code looks like this.

$ArrayGrid_Queue[$ArrayGrid_QueueRowCount][0] = $JobNumber ; JobNumber

$ArrayGrid_Queue[$ArrayGrid_QueueRowCount][1] = $Array_JobNumberCurrentStatus[1]) ; JobNumber current Status.

$ArrayGrid_Queue[$ArrayGrid_QueueRowCount][2], $InputNumberOfCopies) ; Number of Copies to Burn.

$ArrayGrid_Queue[$ArrayGrid_QueueRowCount][3], $File2Add2QueueImage) ; "ISO/Image File Name"

$ArrayGrid_Queue[$ArrayGrid_QueueRowCount][4], $File2Add2QueueCover) ; "Cover File Name"

$ArrayGrid_Queue[$ArrayGrid_QueueRowCount][5], $InputRobotNumber) ; "RobotNumber"

$ArrayGrid_Queue[$ArrayGrid_QueueRowCount][6], 1 ) ; "RecorderBankNumber"

$ArrayGrid_Queue[$ArrayGrid_QueueRowCount][7], $InputRecorderNumber) ; "RecorderNumber"

$ArrayGrid_Queue[$ArrayGrid_QueueRowCount][8], $InputJobPriority) ; "JobPriority"

;Increment the row counter so the next job added does not overwrite this job.

$ArrayGrid_QueueRowCount = $ArrayGrid_QueueRowCount + 1; this way, i don't overwrite info.

thanks for responding though.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...