Jump to content

_StringBetween strange problem


Recommended Posts

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

: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

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...