Sign in to follow this  
Followers 0
Miguel

Need help comparing String to Number

6 posts in this topic

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

Share this post


Link to post
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

Share this post


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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Thanks Mega,

It was so simple...

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