i'm trying to understand the use of atoi in script commands but for some reason i can't seem to understand.
*atoi("<string>")These commands are used to convert strings to numbers.'atoi' will interpret
given string as a decimal number (base 10),while'axtoi' interprets strings as
hexadecimal numbers (base 16).'strtol' lets the user specify a base (valid range
is between 2 and 36 inclusive, or the special value0, which means auto-detection).The'atoi' and 'strtol' functions conform to the C functions with the same names,
and 'axtoi' is the same as strtol, with a base of 16.Results are clamped to signed32 bit int range (INT_MIN ~ INT_MAX).Examples:.@var= atoi("11");// Sets .@var to 11
Based on script commands i noticed the example given is setting the
.@var= atoi("11")
what's the difference if i were to directly put set .@var = 11? aside from it being string and integer.
On the Horror Toy Factory and other scripts, i noticed they used this alot but i can't seem to understand that portion at all, would be great if someone could explain on how it exactly functions. Thank you in advance! Here's one part of the script in Horror Toy Factory that used Atoi
Question
ToiletMaster
Hi guys,
i'm trying to understand the use of atoi in script commands but for some reason i can't seem to understand.
Based on script commands i noticed the example given is setting the
what's the difference if i were to directly put set .@var = 11? aside from it being string and integer.
On the Horror Toy Factory and other scripts, i noticed they used this alot but i can't seem to understand that portion at all, would be great if someone could explain on how it exactly functions. Thank you in advance! Here's one part of the script in Horror Toy Factory that used Atoi
Edit:
Added another portion of the script of Horror Toy Factory that uses it that i can't exactly understand on how the switch cases relate to Atoi
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.