Converting a string Variable to a numeric variable

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
mraftary
Newbie
Posts: 10
Joined: Tue Sep 28, 2004 12:05 pm
Location: Detroit, Michigan, USA

Converting a string Variable to a numeric variable

Post by mraftary » Tue Oct 11, 2005 1:21 pm

Hi:
I am using GetWindowText to gather some information and I need to extract a number from the text and use it in a formula. I can extract the needed text ok but I need to convert it to a numeric value. Any suggestions?

Thanks,
Matt

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Tue Oct 11, 2005 1:27 pm

Once extracted just use it in your calculation. Macro Scheduler will automatically treat it as a number. Any numeric value, so long as it has no non-numeric characters in it (such as spaces) will work as a number in calculations.
MJT Net Support
[email protected]

mraftary
Newbie
Posts: 10
Joined: Tue Sep 28, 2004 12:05 pm
Location: Detroit, Michigan, USA

Post by mraftary » Tue Oct 11, 2005 1:32 pm

Thanks...boy is my face red! That's the way I expected it to work but I kept getting an error. Now I realize I had a typo in one of the variables.

It's a day after a holiday so....

Thanks again,
Matt

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts