spartacus
26th August 2011, 11:40
I have a string like buf = "abc" & chr$(29) & "def"

I tried to seperate it with: string.scan(buf,"%schr$(29)%s",var1,var2)

or

string.scan(buf,"%s" & chr$(29) & "%s",var1,var2)

none of them works.

What will be the right syntax?

Thanx
Richard

george7a
26th August 2011, 11:48
Make sure you have defined the variables correctly. The following code worked for me:

string buf(100),var1(3),var2(3)

buf = "abc" & chr$(29) & "def"
string.scan(buf,"%s"&chr$(29)&"%s",var1,var2)
| after this command var1 had "abc" and var2 had "def"

spartacus
26th August 2011, 12:28
Hi George,

great :):):)

great it works. I don't know what I had wrong. At least the second example I posted here works know. First I tried it, exactly how you did, without any spaces again and it works.
Then I tried it with spaces as in my second example I posted here and it works also!!

Maybe I misstyped something ...I like to interchange "$" and "&" ;)

Kind regards
Richard

george7a
26th August 2011, 13:19
Great :)

It also might be that the program was still running while you compiled and tried again. If so, the changed wont affect.