-
Notifications
You must be signed in to change notification settings - Fork 4
Control Structures
TheRealMichaelWang edited this page May 6, 2021
·
1 revision
FastCode supports a variety of control structures to organize control flow. However, it should be kept in mind that FastCode does not implement for loops.
if condition1 {
do_task1()
}
elif condition 2 {
do_task2()
}
else {
do_task3()
}
Note: None of these method identifiers are valid ... unless you choose to define them.
or alternatively with the => notation...
if condition1 => one_statment_only()
elif condition2 => second_single_statment()
else => last_single_statement()
Note: Using the => notation only reads one statement as the body of the control structure.
while condition {
do_something()
}
or alternatively...
while condition => do_something