sscanf multiple paramteres usage
#6

I'm just giving an extra method of doing that.
Код:
new value1, value2;
if (!strcmp(params, "option1", true, 7))
{
    if (sscanf(params[8], "ii", value1, value2))
        return Usage message "/cmd option1 [value1] [value2]";
}
else if (!strcmp(params, "option2 ExtraOption", true, 19))
{
    if (sscanf(params[20], "i", value1))
        return Usage message "/cmd option2 ExtraOption [value1]";
}

/cmd [option] [whatever]
I think it's better, because strings with spaces can cause problems with detecting them in sscanf.
Reply


Messages In This Thread
sscanf multiple paramteres usage - by Ripster - 01.08.2016, 18:40
Re: sscanf multiple paramteres usage - by J0sh... - 01.08.2016, 18:41
Re: sscanf multiple paramteres usage - by Luicy. - 01.08.2016, 18:46
Re: sscanf multiple paramteres usage - by Ripster - 01.08.2016, 18:57
Re: sscanf multiple paramteres usage - by Konstantinos - 01.08.2016, 19:14
Re: sscanf multiple paramteres usage - by Stinged - 01.08.2016, 19:21

Forum Jump:


Users browsing this thread: 1 Guest(s)