Conditional statements
JM-'s Conditional statements, just like Data types are similar to C/C++, except for her, that always needs to stay edgy af.
JM- also supports mathematics' logical conditions.
Syntax & Examples
Conditional statements' syntax; *Note: Only the last conditional statement ends with a semicolon *Note: You can ignore whitespaces, they got added for readability
// If statement syntax example - Extracted from the, PIDD
if (<condition>) : {
// Code here
};
// Else if statement syntax example - Extracted from the, PIDD
if (<condition>) : {
// Code here
}
else if (<condition>) : {
// Other code here
};
// Else statement syntax example - Extracted from the, PIDD
if (<condition>) : {
// Code here
}
else : {
// Other code here
};
// Switch statement syntax example - Extracted from the, PIDD
switch.<variableDataType>(<variableName>) {
<caseNum>*<condition>:
// Code here
sgo; // `switch.go.on;` Tells the switch to check other cases
<caseNum>*<condition>:
// Other code here
sgo;
};
*Sidenote: A switch{}
function must have a minimum of 2 cases.
-> The second one can also be an empty case with an sgo;
only.
Last updated
Was this helpful?