09-28-2011 01:40 AM
Hello comunity,
i have a problem in dynamically filling an empty array of containers with the corresponding container elements.
Background is , i receive values from a database with the TS Database functions and write them into a container with 2 strings and 1 number.
The count of the containers is variable and depends on the database inserts. Now i need the whole information after getting the information form db at
one time to get a drop-down selection of one string of the container.
It is a requirement of the program that this action is not made in an vi but in a TS statement.
How do i code this in TS ?
I tried this :
FileGlobals.dbInformationName[Locals.index]=FileGlobals.dbResultList.surename,
FileGlobals.User.id=FileGlobals.dbResultList.id,
FileGlobals.User.firstName = FileGlobals.dbResultList.firstname,
FileGlobals.User.surname= FileGlobals.dbResultList.surename,
InsertElements(Parameters.dbResults,"Locals.index", FileGlobals.User)
, but i always get a error message -> Expected Number, found Container.
Can anyone please help me with this matter ?
Thank you very much.
B.R.
04-19-2012 06:33 AM
Hi,
The "InsertElements" function will only insert new elements to your existing array. And you are getting errors because the third parameter should be a number saying how many elements needs to be inserted.
For the application you mentioned, you can use the flow control steps in teststand for looping ( loop index may be same as the number of elements, dynamically assigned) and assigning the elemnts using TS statement steps.
Regards
Ranjith Naduvil