02-07-2010 07:03 PM
I am working on this project that, for one test step returns one long string in the result container, and I need to parse this string by a deliminator into unknown number of tokens so that it can be recorded individually. I have couple ideas in my mind, but I am not sure if this is the best way.
One idea, I am thinking to use "C Struct" for the function parameter in the test step. The function that this test step would call parses the string and outputs to the "C Struct". The dynamic array size would be allocated in the function, and this C Struct class is a wrapper around that array. For example:
TokenList:container
NumberOfToken:number
Token[]:array of string <==initially empty
output will be
TokenList:container
NumberOfToken:number
Token[0..3]:array of string <==after parse, four token are store in the Token array.
Second idea is to customize the step type by using the post-step calling a CVI function that would parse the string and stick into "Result" container (can I pass in "Result" container and modify this container in a CVI function?)
Thank you.
Peggy
02-11-2010 12:02 PM
Just reply to my own post as an update. It is able to parse the result string into arrays of tokens by using common adapter class. But I realize the database recording is by sub-properties, step, and then UUT only. The original thought of using array to have multiple records in the database does not work.
02-12-2010 03:03 PM