
-----------------------------------
HaVoC
Wed Nov 12, 2003 4:08 pm

If statement, needs a boolean type
-----------------------------------
I'm trying to make a simple calculator. Just with 2 numbers and 4 operations. +,-,*,/

My if statement is this

if
op:= +
ans:= num1+num2
end if

Except it says my if statement needs type boolean? What do I do?

-----------------------------------
Mazer
Wed Nov 12, 2003 5:18 pm


-----------------------------------

Except it says my if statement needs type boolean? What do I do?

it  says it needs type boolean because if statements use boolean (true or false) comparisons and execute a specified section of code if it is true and another section of code (if specified) if it's false.

:= is for assigning values to variables
= is for comparing variables

thus, your if statement should read:

if op = "+" then
    ans := num1+num2
end if 

thats assuming your code has a string variable called op that you use to get input from the user ("+", "-", "*", "/")

-----------------------------------
Chimaera
Wed Nov 12, 2003 7:37 pm


-----------------------------------
thus, your if statement should read: 
Code: 

if op = "+" 
    ans := num1+num2 
end if  


You mean

If op = "+" then
ans:=num1+num2
end if


 :wink:

-----------------------------------
Mazer
Wed Nov 12, 2003 8:13 pm


-----------------------------------
lol, what are you talking about, chimaera? you shouldn't go around quoting people and then changing the text in the quote.  :wink:

-----------------------------------
Chimaera
Wed Nov 12, 2003 8:17 pm


-----------------------------------
What?! Me change words around?!

I may be old, blind, a communist, stupid and change words around while you're not looking but I'm not a porn star! XD


I spy with my little eye 
Last edited by Mazer on Wed Nov 12, 2003 8:11 pm; edited 1 time in total

-----------------------------------
Mazer
Wed Nov 12, 2003 9:13 pm


-----------------------------------
man... there needs to be a "shifty eyes" emoticon or something... i mean... i um..  well you see i...  :guns: 


I may be old, blind, a communist, stupid and change words around while you're not looking but I'm not a porn star! XD 


liar! i saw the pictures! i saw the movies! i saw the used condoms! (P.S. ewww)

-----------------------------------
compudave
Wed Nov 12, 2003 11:05 pm


-----------------------------------
liar! i saw the pictures! i saw the movies! i saw the used condoms! (P.S. ewww)

 :lol: lmao, funny but dude that's gross...  :lol:

-----------------------------------
HaVoC
Thu Nov 13, 2003 11:07 am


-----------------------------------
Ok, well, I fixed it before I looked at this post. My tech teacher helped me out. Anyways, thanks, it helped in the long run. Though I had to set the ans variable to 'real' before I could do division. Can anyone tell me how to go about making an interface?

-----------------------------------
Chimaera
Thu Nov 13, 2003 9:06 pm


-----------------------------------
what sort of interface are you looking for? GUI? Text? Or do you want there to be boxes that you click on and text boxes for you to type in?

-----------------------------------
HaVoC
Thu Nov 13, 2003 9:38 pm


-----------------------------------
Well, a GUI would be nice, but before I do that, what is the code to implement a BMP?

Do you know a place, with a list of ALL commands, and their descriptions?

-----------------------------------
AsianSensation
Thu Nov 13, 2003 9:46 pm


-----------------------------------
it's called the turing help files, lol :lol: 

F10 button

-----------------------------------
Tony
Thu Nov 13, 2003 9:47 pm


-----------------------------------
there's a tutorial on importing pictures into turing in TUTORIALS section. As for all commands... help file (F10 in turing) is helpful at times.

-----------------------------------
HaVoC
Fri Nov 14, 2003 9:32 pm


-----------------------------------
All that did was enable tracing

-----------------------------------
Dan
Mon Nov 17, 2003 4:42 pm


-----------------------------------
All that did was enable tracing

I dont what verson of turing you have but in all the ones i have used have F10 bring up the help file if they have it and the F9 birngs up the help file for the slected worad.

if you have one of the erail versons of turing 4.x you may have to get the upgrade from the holth group web site to get the help files

-----------------------------------
HaVoC
Tue Nov 18, 2003 8:46 pm


-----------------------------------
What's the Holth Group URL?

-----------------------------------
Thuged_Out_G
Tue Nov 18, 2003 8:56 pm


-----------------------------------
www.holtsoft.com

i think thats it
