hanchilicious
Programmer
Hi!
I have this string that looks like
xxx*yyyyy*zz*aaaaaaa*b*cccc*dddd*
The string length may vary (but is unlikely to exceed 254 characters).
The asterisks are delimiters, and I need to assign everything that is between the asterisks to different variables.
For example:
stringvar x := mid({string},1,instr({string},'*')-1)
So x = 'xxx', y = 'yyyyy', z = 'zz', etc.
I would need to do the same thing for stringvar y and onwards, but, whilst I can find the starting position for that variable, how can I tell it when to stop?
stringvar y := mid({string},instr({string},'*')+1,<length of field between 1st and 2nd chars here>)
An array is probably what I need to use here but I seem to be having some trouble in getting that to work. Can anyone give me an idea of how to achieve this?
Thank you!
<H>
I have this string that looks like
xxx*yyyyy*zz*aaaaaaa*b*cccc*dddd*
The string length may vary (but is unlikely to exceed 254 characters).
The asterisks are delimiters, and I need to assign everything that is between the asterisks to different variables.
For example:
stringvar x := mid({string},1,instr({string},'*')-1)
So x = 'xxx', y = 'yyyyy', z = 'zz', etc.
I would need to do the same thing for stringvar y and onwards, but, whilst I can find the starting position for that variable, how can I tell it when to stop?
stringvar y := mid({string},instr({string},'*')+1,<length of field between 1st and 2nd chars here>)
An array is probably what I need to use here but I seem to be having some trouble in getting that to work. Can anyone give me an idea of how to achieve this?
Thank you!
<H>