Jump to content
Sign in to follow this  
sr243

annoying Number() function

Recommended Posts

sr243

I am trying to write a script which uses the number() function.

Basically, the program is supposed grab the clipboard, which will already have a mathematical expression (e.g "5 + 5") and then solve it and send() the answer.

This is what I have so far:

$a=clipget()

$b=number($a)

send($:)

However, because the expression in the clipboard is read as a string, the number function isn't solving the expression.

Instead, when I have an expression like "256 - 4", it would simply output "256" as it reads it as a string and cuts everything after the sign.

Any hints on how to solve this problem?

Share this post


Link to post
Share on other sites
FreeFry

Try using Execute instead:

Send(Execute(ClipGet()))

Edit:

Doh, cppman beat me too it. :)

Edited by FreeFry

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  

×