Sign in to follow this  
Followers 0
AlmarM

Need some help here.

4 posts in this topic

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 :P

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.

Share this post


Link to post
Share on other sites



In your case $FirstMap[0] is the number of element the string was partitioned into. I think you want the first element, [1].

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Oh, stupid me :P

Thx guys :unsure:

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0