Calculator in Developer Help
|
|
Code:
proc Calculator (var/X=0, var/Y=0, var/Z=0) switch(input("What type of Calculation")in list("Adding","Minus","Times","Divided")) if("Adding") X=input("Input A Number","Number") Y=input("Input A Number","Number") Z="[X]"+"[Y]" usr<< Z
|
Problem description:
I am trying to add X and Y to = Z but my input detects it as a text not a number i was wounder how am i suppose make it so it outputs the two numbers add not just in a text string
Side Note
omit me not doing the other if statements
|
Don't use usr in procs. I also don't know why you are using Z as an argument in the proc, as Z is what you are looking for in the calculation, not as a given value. Also, you do not need to declare them with var/ in a proc's arguments. This will simply do:
You are doing way too much for what is needed. I have a feeling you don't quite understand named arguments yet. Keep at it, though.