add substrings to an array
hi folks,
i have a string of numbers which i want seperated so that every figure has its own place in an array. i tried it this way, but i couldn't get it working:
proc dothis()
{
print ("barcode" + "\n");
global string $barcode;
$barcode _= `textField -query -text barcode1`;
for ($i=1; $i<=(size($barcode)); $i++) {
$barpiece =`substring $barcode $i $i`;
global string $barc[];
string $barc[$i] = {$barpiece};
}
}
at least i think it should work like this, but well, being a newbie... :unsure:
anyway the error i get is:
// Error: _string $barc[$i] = {$barpiece}; //
// Error: Syntax error //
i hope you can help me with this issue.
thanks in advance!
greetings
joh