30.01.2014, 18:00
So, finally I thought I would learn zcmd and sscanf and give up the old strcmp..
I started looking on wiki for sscanf and I found this.
But I got stuck on these two lines:
What is the differance between a string and an optional string?
I started looking on wiki for sscanf and I found this.
Код:
Function: sscanf Params: string[] - String to extract parameters from. format[] - Parameter types to get. {Float,_}:... - Data return variables. Return: 0 - Successful, not 0 - fail. Notes: A fail is either insufficient variables to store the data or insufficient data for the format string - excess data is disgarded. A string in the middle of the input data is extracted as a single word, a string at the end of the data collects all remaining text. The format codes are: c - A character. d, i - An integer. h, x - A hex number (e.g. a colour). f - A float. s - A string. z - An optional string. pX - An additional delimiter where X is another character. '' - Encloses a litteral string to locate. u - User, takes a name, part of a name or an id and returns the id if they're connected. Now has IsNumeric integrated into the code. Added additional delimiters in the form of all whitespace and an optioanlly specified one in the format string.
Код:
s - A string. z - An optional string.