• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

[JASS] Question about S2I

Status
Not open for further replies.
Level 10
Joined
Aug 19, 2008
Messages
491
StringHash:
StringHash takes a string and returns an integer much like S2I, however StringHash can be used on any string.
(Quote)

So, Karune says that it can convert ANY string to an integer.
So S2I("Epic string") will give me an integer? And will it be different from, say, S2I("Second epic string")?

(Don't bother with a long detailed information about how it works, I'm not that good at programing yet and I feel that this topic could go very deep...)
 
Level 6
Joined
May 7, 2009
Messages
228
S2I only works on strings that are a number in word form

So for example, S2I("14372") will return 14372
but you aren't allowed to do S2I("Epic")

StringHash returns a number that is basically unrelated to the actual content of the string
so for example
StringHash("14372") might return -1651642854
while StringHash("Epic") might return -989422131

At least that's what I think/ I'm not positive about this
 
Status
Not open for further replies.
Top