Jump to content
Sign in to follow this  
jbnh

_StringBetween strange problem

Recommended Posts

jbnh

Hello everyone

I fetch a txt file from internet and i want to get a number that is in.

This number is never the same so i use _StringBetween

Here's for example the line html code:

<a href="daoc://71.164.188.115:10300" onmouseover="Tip('You must have DAoC Portal installed for this link to work!')">Connect</a></td><td class="">12</td>

I do so:

$String = FileRead($file)
$player1 = _StringBetween($String, '<a href="daoc://71.164.188.115:10300" onmouseover="Tip(''You must have DAoC Portal installed for this link to work!'')">Connect</a></td><td class="">', '</td>')
MsgBox(0,"",$player1)

But i recieve nothing in the msgbox.

PS: i cant use something smaller than :

'<a href="daoc://71.164.188.115:10300" onmouseover="Tip(''You must have DAoC Portal installed for this link to work!'')">Connect</a></td><td class="">'

Cause there is similar sentence in the txt.

Quotes problem?

Thanks to use easy english words

CU

Edited by jbnh

Share this post


Link to post
Share on other sites
BrettF

:P

#Include <String.au3>
$line = "<a href=""daoc://71.164.188.115:10300"" onmouseover=""Tip('You must have DAoC Portal installed for this link to work!')"">Connect</a></td><td class="""">12</td>"
$ret = _StringBetween ($line, "<a href=""daoc://71.164.188.115:10300"" onmouseover=""Tip('You must have DAoC Portal installed for this link to work!')"">Connect</a></td><td class="""">", "</td>")
MsgBox (0, "", $ret[0])

Helpfile says so:

Return Value

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

Failure: 0

@Error - 1 = No inbetween string found.

Add some error checking before calling the message box, or it will crash. (IsArray, If @Error Then....)

Cheers,

Brett

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.