Page 1 of 1

formatting a string array

PostPosted: Wed Sep 11, 2013 12:39 pm
by chriss0212
hi

i am trying to get values out of a string array.

value is for eg: value1|value2|value3

i am trying to get values out of it by a custom script:
VGetArrayValue,Motor1,0,test

where Motor1 is the target and test is the string array. the command is just returning the complete array by using 0 as index. higher value for index is returning nothing!

greetz

christian

Re: formatting a string array

PostPosted: Thu Sep 12, 2013 10:53 am
by Dennis Kuypers
Hi Christian,

When using "VArrayReverse" on your string array, do the values positions flip? If this is not the case then the problem is that your array consists of one value "value1|value2|value3" instead of three values "value1","value2","value3".

Best regards
Dennis

Re: formatting a string array

PostPosted: Thu Sep 12, 2013 11:34 am
by chriss0212
hi dennis

but how do i need to format a string, that wd is recognizing it as an array?

i wnat to sned a string over udp and put it into the array...how can i do this?

greetz

christian

Re: formatting a string array

PostPosted: Thu Sep 12, 2013 12:09 pm
by Dennis Kuypers
Hi Christian,

You can alter the length of the array and then address each array field individually using the following functions
Code: Select all
# Resizing
VArrayResizePreserve,VarName,Size
VArrayResize,VarName,Size
# accessing individual entries
VGetArrayValue,VarName,Index,ArrName
VSetArrayValue,VarName,Index,Value


Best regards
Dennis