|
JScript GetArrayVariable() Foo from Netherlands [2 posts] |
8 year
|
I try to get the confidence array form the fiducials data in a JScript with the GetArrayVariable() function
I do get data but when I Write() the data or use a WatchVariable component the data is wrong.
fiducialConfidenceArray = GetArrayVariable("FIDUCIAL_CONFIDENCE_ARRAY")
Write(fiducialConfidenceArray + "\n" );
SetVariable("TEST",fiducialConfidenceArray)
any tips or is something wrong with the GetArrayVariable() function?
|
|
|
Steven Gentner from United States [273 posts] |
8 year
|
You may find
fiducialConfidenceArray = GetArrayVariable("FIDUCIAL_CONFIDENCE_ARRAY")
if (fiducialConfidenceArray != null)
{
Write(fiducialConfidenceArray[0] + "\n" );
SetArrayVariable("TEST",fiducialConfidenceArray)
}
to be more correct. Note this assumes that you checked the "create array" in the Fiducials module and that you just wanted to print out the first element[0] of the array.
Note the use of SetArrayVariable instead of SetVariable.
STeven.
|
|