Sign in to follow this  
Followers 0
Immensee

Old Autoit'er looking for simple help

4 posts in this topic

Heya , ive been using autoit for a long period now, but i can't understand this stupid command:

MsgBox(0, "", _StringBetween("MAX", "M", "X"))

Well, i want to get A here and let it show it with MsgBox(). But, using the _stringbetween command i get "", nothing.

And in my real script i DO have #include string

any help?

Share this post


Link to post
Share on other sites



Heya , ive been using autoit for a long period now, but i can't understand this stupid command:

MsgBox(0, "", _StringBetween("MAX", "M", "X"))

Well, i want to get A here and let it show it with MsgBox(). But, using the _stringbetween command i get "", nothing.

And in my real script i DO have #include string

any help?

It returns an Array.

#include <String.au3>
$x = _StringBetween("MAX", "M", "X")
MsgBox(0, "",$x[0] )

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

O_O... why it returns into an array...

it doesn't make sense :P and the Help file didnt say that at all....

well thanks man :D,

now i can AutoIt with fun again ;)

immense aka naruto

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

It returns an array because it's capable of returning multiple values.

#include <String.au3>

$returns = _StringBetween('[Hello] [World]', '[', ']')
For $val in $returns
   MsgBox(0, '', $val)
Next

*Edit: Also...

Return Value

Success: A 0 based $array[0] contains the first found string.

Failure: 0

@Error: 1 = No inbetween string found.

Edited by Saunders

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