12-17-2007 06:39 AM
12-17-2007 06:50 AM
12-17-2007 07:27 AM
Hello Ray,
That is my approach. Instead of using complicated string manipulations, is there a simple method to filter brackets in case size of array will be increased e.g. from [9][2] to [10][2] ? It would nice to have integrated functions in TestStand to do these things for arrays.
Regards,
Petri
12-17-2007 07:43 AM
Hi Petri,
I can only think of SearchAndReplace.
If you do SearchAndReplace "][" to "," then change the "[" to "" and "]" to "" this will leave you a resultant string of "9,2".
If you then convert to number by Val(Str(resultant),"%f")) you will get a number of 9.2
Dont know if that will help you
Regards
Ray
12-17-2007 08:03 AM
Hello Ray,
Thanks for your quick answers. Yes, that could be an approach, unfortunately there is no function to get integer and decimal from 9.2 float. Probably it could be easier to do the job in CVI or LV which I was thinking about to avoid.
By the way, second parameter in Val() returns boolean according to 3.5. I'm not sure if "%f" could work or has any effect.
Regards,
Petri
12-17-2007 08:20 AM
Hi,
There is a Str() to format it to float before turning it to Val() eg..Val(Str(..)).
Yeah you still need to get the left and right side of the decimal point.
Or you can take the "9,2", wrap it with {} and use it to initials an empty array.
eg Locals.MyArray = Evaluate ( "{"+Locals.resultant + "}") where Locals.resultant = "9,2".
But you are right, probably easy to pop into labview.
Regards
Ray
12-17-2007 08:51 AM
12-19-2007 03:51 AM
12-19-2007 04:43 AM
That's OK, glad it was useful.
Regards
Ray