AutoHotkey Community

It is currently May 27th, 2012, 4:16 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: February 19th, 2010, 9:34 am 
Offline

Joined: February 19th, 2010, 9:15 am
Posts: 3
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 February 19th, 2010, 9:38 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 19th, 2010, 9:37 am 
Offline

Joined: June 6th, 2006, 3:19 pm
Posts: 1654
Location: Denmark
Don't use % around variables in expressions (:=):
Code:
Bet25 := 2.5 * bb ; This is the multiplicatition.

_________________
RegEx Powered Dynamic Hotstrings
COM
AutoHotkey 2


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 19th, 2010, 9:46 am 
Offline

Joined: February 19th, 2010, 9:15 am
Posts: 3
Thank you very much.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: rbrtryn and 68 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group