i have written a small module but need one help in it...i am able to return only two values from my function...like 1 or -1 only two values work in ser.cfg...either i can return true or false....is there anyway i can return more than one value and treat them in ser.cfg and then depending upon returned value from module....can do specific action.....
_________________________________________________________________ Skin is in! Bollywood is sizzling. http://server1.msn.co.in/slideshow/striptease/ Check out these hot pics!
On Mar 03, 2004 at 13:48, Kapil Dhawan sersavvy@hotmail.com wrote:
i have written a small module but need one help in it...i am able to return only two values from my function...like 1 or -1 only two values work in ser.cfg...either i can return true or false....is there anyway i can return more than one value and treat them in ser.cfg and then depending upon returned value from module....can do specific action.....
You can return 3 values: 1 (true), -1 (false) and 0 (which will stop the script processing, equivalent with break or drop).
Right you can't return more values and there is no way to treat them in ser.cfg. This will change when we will add variables and functions in script.
Andrei
P.S.: for development please use serdev@lists.iptel.org
Skin is in! Bollywood is sizzling. http://server1.msn.co.in/slideshow/striptease/ Check out these hot pics!
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
One way around "having many return values" is to keep a global variable into your module which stores the code and an exported function that check this value.
You would have
if(do_whatever(...)) { # function processed, no check the code if(check_whatever_code("1")) # that returns true of the code is 1 { }; if(check_whatever_code("2")) # and so on... { }; };
.Daniel
On 3/3/2004 10:43 PM, Andrei Pelinescu-Onciul wrote:
On Mar 03, 2004 at 13:48, Kapil Dhawan sersavvy@hotmail.com wrote:
i have written a small module but need one help in it...i am able to return only two values from my function...like 1 or -1 only two values work in ser.cfg...either i can return true or false....is there anyway i can return more than one value and treat them in ser.cfg and then depending upon returned value from module....can do specific action.....
You can return 3 values: 1 (true), -1 (false) and 0 (which will stop the script processing, equivalent with break or drop).
Right you can't return more values and there is no way to treat them in ser.cfg. This will change when we will add variables and functions in script.
Andrei
P.S.: for development please use serdev@lists.iptel.org
Skin is in! Bollywood is sizzling. http://server1.msn.co.in/slideshow/striptease/ Check out these hot pics!
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Hi one more thing ..whats the maximum value flag...using setflag
Regards
Dhawan K
Hello, the flags are mapped as bits in an unsigned int, so the range is 0, ..., 31.
.Daniel
On 3/2/2004 5:25 AM, Kapil Dhawan wrote:
Hi one more thing ..whats the maximum value flag...using setflag
Regards
Dhawan K
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers