Warcraft 3 documentation
vJASS & Zinc Documentation
For the latest documentation about how it works vJASS and Zinc language layers for Warcraft III, please follow these links:
Jasshelper documentation - Zinc documentation - WC3 Optimizer documentation
This topic is the discussión abut the function S2I. You can see all the information about this function keyword HERE.

[functions] S2I No New Posts Jassdoc

Started by
City17

0 Members and 1 Guest are viewing this topic.

[functions] S2I
on: February 25, 2022, 02:51:51 PM

returns an integer by parsing the string for a number.
For values too big or too small, returns max/min integer respectively. For an empty string or text that doesn't start with a number, returns 0. For null raises an error.
The parser stops at the first non-number character [0-9.]

Examples (Lua):
Code: [Select]
S2I("") -- 0
S2I("-123") -- -123
S2I("-99999999") -- -2147483648
S2I("99999999") -- 2147483647
S2I("123abc") -- 123
S2I("abc123") -- 0
S2I(nil) -- error




 

Started by moyack

Replies: 3
Views: 4233
Jassdoc

Started by Jedi

Replies: 5
Views: 14820
General Jass Discussion

Started by moyack

Replies: 40
Views: 58679
Jass Theory & Questions

Started by moyack

Replies: 0
Views: 658
Jassdoc

Started by moyack

Replies: 0
Views: 649
Jassdoc
Vivir aprendiendo.co - A place for learning stuff, in Spanish   Chaos Realm - The world of Game modders and wc3 addicts   Diplo, a gaming community   Power of Corruption, an altered melee featuring Naga and Demon. Play it now!!!   WC3JASS.com - The JASS Vault + vJASS and Zinc   Jetcraft - A Starcraft II mod   WormTastic Clan (wTc)   Warcraft RESOURCES Reforged: Modelos, mapas, proyectos y mas...