11-28-2016 07:33 AM
hallo,
I have an Array of container Cmix. Cmix has many elements one of then is numeric element "n"
I need to initialise only this element "n" with a default value. I want t avoid using for ..loop.
can the same be acheived with some Array funtion or property object.. like setelements()...
11-28-2016 07:42 AM
Hi,
Take a look at this topic: http://forums.ni.com/t5/NI-TestStand/Loop-in-a-Pre-Expression/m-p/839137
I quite like Eric Crank's use of recursive evaluations as a solution.
Regards,
Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)
Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor
11-29-2016 06:20 AM
thanks Charlie,
yes its doable, although quite some code and encapsulated in a statement which is less readable. Ithought Testand provides
some funtion to solve the issue.
all in all a good workaround...
regards,
thanks
11-30-2016 11:36 AM
There is a SetElements function but it depends which TestStand version you are using
SetElements(Array array, PropertyObject value, [String range])
This function assigns the passed value to all indices of the passed array. If an index range is specified, only elements in the range are assigned the passed value.
Parameter 1: An array to which the value should be assigned.
Parameter 2: The value which is to be assigned to the specified parts of the array.
Parameter 3: An optional parameter specifying the range string specifying the indices of the array to which the value should be assigned. For example, the range "[0..2]" specifies elements [0], [1], and [2]. If unspecified, the range is assumed to be the whole array. Refer to the "Brackets" section in the Expression Operators help topic for more information on specifying an index range.
Returns: This function always returns 0.
regards
Ray