AlmarM Posted March 11, 2009 Share Posted March 11, 2009 Hello, Lets say I have this string "oasis;fueldump;radar;railgun;goldrush;battery" Now I need to get the first word in this string. (oasis). The string could be anything, depending on what the users inserts. I tried something like $String = "oasis;fueldump;radar;railgun;goldrush;battery" $FirstMap = StringSplit($String, ";") $FirstMapEx = $FirstMap[0] MsgBox(0, "", $FirstMapEx) But its not my day AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
Authenticity Posted March 11, 2009 Share Posted March 11, 2009 In your case $FirstMap[0] is the number of element the string was partitioned into. I think you want the first element, [1]. Link to comment Share on other sites More sharing options...
Negative1 Posted March 11, 2009 Share Posted March 11, 2009 In your case $FirstMap[0] is the number of element the string was partitioned into. I think you want the first element, [1]. Indeed and $FirstMap[0] is the total number of elements which is why you get msgbox 6 so you can use while $var <= $firstmap[0] to use all the map names What are we going to do tonight Brain?Same thing we do every night Pinky try to automate the world. Link to comment Share on other sites More sharing options...
AlmarM Posted March 11, 2009 Author Share Posted March 11, 2009 Oh, stupid me Thx guys AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now