[foo, bar, baz] = array_sscanf(...);
[foo, bar, baz] = array_sscanf(...); doesn't equal sscanf(...,foo,bar,baz), unfortunately.
| > int foo,bar,baz; | > sscanf("17,42","%d,%d,%d",foo,bar,baz); | (1) Result: 2 | > foo; bar; baz; | (2) Result: 17 | (3) Result: 42 | (4) Result: 0
| > [foo,bar,baz]=array_sscanf("17,42","%d,%d,%d"); | Not enough values for multiple assign. | HilfeInput:1: HilfeInput()->___HilfeWrapper()
/ Mirar
Previous text:
2003-12-23 04:20: Subject: Re: C#-like properties
Perhaps, cleaner solution would be to implement a reference to variable (something like x(int &x) in C/C++ or x(ref int i) in C#),
we are trying to reduce the syntax (in this discussion anyways)
you may need to assign values from this array to variables.
[foo, bar, baz] = array_sscanf(...);
Imagine that your application doing sscanf() most of time, then try to replace sscanf() with array_sscanf() - you will see the difference. Not that this is _so_ critical nowadays, but "why pay more?"
how many calls to sscanf will it take before this difference becomes significant?
greetings, martin.
/ Brevbäraren