Jump to content

Need help comparing String to Number


Recommended Posts

here is my code:

$sText = "<td id=l4 title=125>23930/320000</td>" & @CRLF & _

"<td id=l3 title=100>38279/320000</td>" & @CRLF & _

"<td id=l2 title=100>98610/320000</td><td>" & @CRLF & _

"<td id=l1 title=-9917>161353/245000</td>"

$as_Matches = StringRegExp($sText,'id=.1 title=[-]*\d*>(\d*)',3) ; retrieves de value 161353 (as a string)

if $as_Matches > 100000 then

MsgBox(0, "Result", "Ok")

EndIf

My problem is the comparison of a String with a number......

How can i compare a String with a number ?

help me, please

Link to comment
Share on other sites

autoit should have no problem converting the string to an integer... i know i did that more than once... and it worked fine :)

Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

Link to comment
Share on other sites

Ok

My problem is that the value that i need to convert to a number the variable $as_Matches

If Number($as_Matches) = 161353 then

Msgbox(0, 'Yay', 'It worked')

EndIf

I have tried this and it didn´t work.

Link to comment
Share on other sites

Hi,

you get an array back!!! You need to compare $as_Matches[0]

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

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