For BASIC at least. In C it would be written as:
#include <studio.h>
int main( void )
{
if(condition)
{
goto label //or variable=Function();
}
return 0;
}
You probably already noted, but that is because the THEN of an IF statement in C is silent. It's only ever represented by brackets. (Or doesn't appear at all when writing next-line statements, which are also a bad programming practice.)
Yes, however many tutorial books still use them with one line if there is only one function to execute in such a case. Of course, it makes perfect sense that the braces would represent the THEN, because they borh say what to execute should if() find the condition return a value other than 0.
And there is no IF statement in C, capitalization is a key thing to remember in C. It's mostly the inverse of BASIC, your commands are usually entirely lowercase, and there is a difference between a variable named 'count' and another called 'COUNT'. Usually uppercase is used for constants. Sorry for being so precise... ;)
@Oscar: Its very close to assembly branch instructions, which I guess BASIC is supposed to be close to...
SUB A, B
BNE A, 12345
@MathPrg: Fun fact: The '{}'s are part of their own grammar definition in C, unlike SB where THEN really does terminate the condition.
<IF>(<EXPRESSION>)<BLOCK>(<ELSE>...)*
<WHILE>(<EXPRESSION>)<BLOCK>
Looks like you've also got some good programming experience... I've messed around with a few extras, my first language I actually committed to learning at all was HTML. I also tried Visual Basic, JavaScript, Java, C, Batch files, Petit Computer's SmileBASIC, of course this SmileBASIC, and C++. Maybe more but I can't remember any others... It's a bit late for me to remember THAT far back...
WAIT A MINUTE... just after I bug Is at about the need to pay attention to capitalization in programming, YOU FORGOT TO CAPITALIZE THE 'R' AND 'G' IN MY NAME?! OF ALL THE UNFORGIVABLE THINGS... YOU SHALL FOREVER BE SHUNNED BY ME! Lol :P