Sign in to follow this  
Followers 0
zipppo

Math with variables

3 posts in this topic

#1 ·  Posted (edited)

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



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  
Followers 0