AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Digits String not treated as a number.

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Gato



Joined: 19 Feb 2010
Posts: 3

PostPosted: Fri Feb 19, 2010 8:34 am    Post subject: Digits String not treated as a number. Reply with quote

Hello. This one must be very simple, but I just canīt find my way thru:

I need to extract a number from a Window Title and then to multiply this number 2.5 times.


Code:



Title = $1.15 NL Hold'em [Double or N... - Tournament 244599760 Table 1 - Blinds $1000/$2000

StringMid, bb, Title, Instr(Title, "/")+2 ;This is the numeric string I need

Bet25 =: 2.5 * %bb% : This is the multiplicatition.

NumPadRight::
MsgBox BB: %bb% ;Message box gives BB: 2000, as expected
Return


NumPadDown::
MsgBox Apuesta: %Bet25% ;This one is not a number, it gives 2.5 * 2000.
Return



Per the tutorial I assumed that bb, as a string consisting only of digits would be treated as a numeric variable when required, but this is not the case.

I really will very much appreciate your help.

Regards


Last edited by Gato on Fri Feb 19, 2010 8:38 am; edited 1 time in total
Back to top
View user's profile Send private message
tonne



Joined: 06 Jun 2006
Posts: 1651
Location: Denmark

PostPosted: Fri Feb 19, 2010 8:37 am    Post subject: Reply with quote

Don't use % around variables in expressions (:=):
Code:
Bet25 := 2.5 * bb ; This is the multiplicatition.

_________________
RegEx Powered Dynamic Hotstrings
COM
AutoHotkey 2
Back to top
View user's profile Send private message
Gato



Joined: 19 Feb 2010
Posts: 3

PostPosted: Fri Feb 19, 2010 8:46 am    Post subject: Reply with quote

Thank you very much.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group