DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Extract Table Data From Dialog Box to Array

Hello,

 

I am having difficulty extracted data from a table in a dialog box to a global variable in my script.

 

First I have a global variable declared as

 

IF Not Iteminfoget("MyVar") Then

     Call GlobalDim("MyVar, MyArray(10)")

END IF

 

and a Table in my user DIalog box called MeasuredTorque(10 rows, 1 cols)

 

I am trying to copy the data from the MeauredTorque to MyArray

 

I am keep getting errors when I try the following  error "Wrong number of arguments or invalid assignment of properties : "MYARRY" "

 

when trying to use the following code

 

MyArray(0) = MeasuredTorque.Cells(1,1).Value

 

I probably have a syntax error but I cannot find any examples using the help menu or my reference material.

 

 

 

Tim
0 Kudos
Message 1 of 2
(3,933 Views)

Hi smoothdurban,

 

That is the correct syntax to read a cell value from a regular SUDialog table control and assign it to a 1D array variable.  Were you by chance using a SUDialog XTable control instead of the regular SUDialog table control?  You should always declare the global variables in the calling VBScript, never in the SUDialog itself-- were you by chance declaring the global variables in the SUDialog?

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 2 of 2
(3,925 Views)