mawright89 Posted July 1, 2013 Share Posted July 1, 2013 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 More sharing options...
AzeoTech Posted July 1, 2013 Share Posted July 1, 2013 Sure: numcols() There are three functions, one for each possible dimension: numrows() numcols() numdepth() Link to comment Share on other sites More sharing options...
mawright89 Posted July 3, 2013 Author Share Posted July 3, 2013 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 More sharing options...
AzeoTech Posted July 3, 2013 Share Posted July 3, 2013 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 More sharing options...
mawright89 Posted July 3, 2013 Author Share Posted July 3, 2013 thats fine, whats the script for running as a function? function.leaktest(leakspools[a]) is that close? Link to comment Share on other sites More sharing options...
mawright89 Posted July 3, 2013 Author Share Posted July 3, 2013 lets put this another way i think im confusing myself; testorder[testnumber] returns the name of the script to be run. can I use that to start the script of the same name or does it not work like that? Link to comment Share on other sites More sharing options...
mawright89 Posted July 4, 2013 Author Share Posted July 4, 2013 One last thing, Im logging values to an array for writing to a .CSV file, how do i change the number of significant figures shown after the decimal point. currently at 6 and dont need that many. Link to comment Share on other sites More sharing options...
AzeoTech Posted July 5, 2013 Share Posted July 5, 2013 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.