Jump to content

Need some help here.


Recommended Posts

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.

Link to comment
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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...