01-21-2020 03:17 PM
Good afternoon,
I have a TS sequence where the user can select the destination storage path of a variable (array of numbers dynamically created) and that path will be stored into another variable (string).
I need to access the array of numbers (whose path is dynamic) to determine its number of elements, get its numeric values, but i couldn´t make it.
E.g.: FileGlobals.DUT.MPI_storagePath = "FileGlobals.Product.MPI" (string with destination path)
FileGlobals.Product.MPI[0...3] (array of numbers)
Thanks in advance!
Regards.
Solved! Go to Solution.
01-21-2020 06:40 PM - edited 01-21-2020 06:43 PM
Trying to wrap my head around what you are trying to do here as it is not very clear. Do you want to convert the array of numbers to a string? or do you want to just get one element from the array and put it to a string?
The Str() function allows any datatype to become a string. So FileGlobals.DUT.MPI_storagePath = Str(FileGlobals.Product.MPI) which will be something like {0, 1, 5, 8 , 2, etc...}.
Or if you are trying to store the lookup string (I think that's what you mean by address) then you can use the evaluate function.
Example: Evaluate(FileGlobals.DUT.MPI_storagePath)[0] to get element 0 or Evaluate(FileGlobals.DUT.MPI_storagePath).GetNumElements() to get the number of elements.
01-21-2020 06:44 PM
Sorry I meant GetNumElements(Evaluate(FileGlobals.DUT.MPI_storagePath))
01-22-2020 09:37 AM
Thanks Jigg!
I didn´t realize that with such a simple expression it can be solved.
Alejandro