formatting a string array

Moderator: Moderator Group

formatting a string array

Postby chriss0212 » Wed Sep 11, 2013 12:39 pm

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
chriss0212
 
Posts: 55
Joined: Sun Aug 10, 2008 12:15 pm

Re: formatting a string array

Postby Dennis Kuypers » Thu Sep 12, 2013 10:53 am

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
Dennis Kuypers
(former Product Developer, Software)
Dennis Kuypers
coolux Germany
 
Posts: 771
Joined: Thu Jul 05, 2012 12:18 pm

Re: formatting a string array

Postby chriss0212 » Thu Sep 12, 2013 11:34 am

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
chriss0212
 
Posts: 55
Joined: Sun Aug 10, 2008 12:15 pm

Re: formatting a string array

Postby Dennis Kuypers » Thu Sep 12, 2013 12:09 pm

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
Dennis Kuypers
(former Product Developer, Software)
Dennis Kuypers
coolux Germany
 
Posts: 771
Joined: Thu Jul 05, 2012 12:18 pm


Return to Widget Designer V4.7

Who is online

Users browsing this forum: No registered users and 24 guests

cron