Jump to content
Sign in to follow this  
zipppo

Math with variables

Recommended Posts

zipppo

I have three variables the first 2 contain a number the third one is + or - how would i set up a problem that is

15 + or - 12

variable1 variable3 variable2 = variableanswer

Thanks ahead of time

Edit for the example 15 is var1 +or- is var3 and 12 is var2.

Edited by zipppo

Share this post


Link to post
Share on other sites
reb

You can do it this way.

$var1 = 15

$var2 = "-"

$var3 = 12

if $var2 = "+" then

MsgBox(0,"",$var1 + $var3)

else

MsgBox(0,"",$var1 - $var3)

EndIf


MEASURE TWICE - CUT ONCE

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.