Number Of Columns In An Array?


Recommended Posts

Is there a script which retuns the number of columns in an array... am using a 2D array with one row, but need to determine the number of columns with values and set a variable to that value. Any ideas on how to do this?

Cheers

Link to comment
Share on other sites

Thanks, can I pass a string from one position lets say;

leakspools[0][3]

into the;

beginseq()

function to start a sequence if the text in the array is named the same as the sequence? I cant seem to get it to work. I am using another variable to set the position of the array data to be extracted;

beginseq(leakspools[a])

Should this be working?

Link to comment
Share on other sites

You can't pass any parameters to a sequence when starting it with beginseq(). You'd have to use a global variable to somehow get it to the sequence. You could pass it as a function of course, but then it runs in the same thread as the calling script:

myFunc(leakspool[a])

Link to comment
Share on other sites

Lots of questions here:

1) to call as a function, its simply:

leaktest(leakspools[a])

You don't do "function." in front.

2) if you have the function name you want to call in a string variable, you have to build up the script as a string then use execute():

execute(testorder[testnumber] + "(leakspools[a])")

3) changing the sig figs depends on how you are logging. In logging / export sets there is a column labelled "Figs". For writeDelim() you'd have to create an array of strings instead of an array of numbers and put the formatted numbers into that array of strings. It might be faster to actually format the entire row into a 1 dimensional array of strings, or simply as a string and write it that way. WriteDelim() itself doesn't give an sig fig options.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.