Control Flow
1. Logic (If / Or)
BigC uses a flat structure for logic. No indentation is needed for if blocks.
if: Checks a condition.or: Performs an action if the previousiffailed.or if: Performs a new check only if the previousiffailed (likeelse if).
Basic Syntax:
if [Condition] & [Command]
# Multi-line Block (Flat)
if [Condition]
print "Condition met"
or
print "Condition not met"
Advanced "Or If" Logic:
if Score > 90
print "Grade: A"
or if Score > 80
print "Grade: B"
or
print "Grade: F"
2. The Mechanics of Failure
BigC is built to be "Crash-Proof." Instead of stopping the program with an error, the engine returns specific fallback values that you can check.
| Action | Result on Failure | How to detect |
|---|---|---|
| BigNet (Web) | "BigNet Error..." | bmath Var @"^BigNet Error" |
| Books (File) | "" (Empty String) | if Var == "" |
| Math | 0 | if Var == 0 |
| JSON | "nothing" | if Var == "nothing" |
Native Error Check
You can use the bug found syntax immediately after an action to detect a failure natively.
Example:
get web "https://broken-link.com" & set as {Response}
if any bug found
print "Error: Connection failed!"
or
print "Success: $Response"
3. Loops (Strict Indentation)
Loops are the only time BigC uses indentation (4 spaces or 1 tab) to indicate repetition.
Syntax:
start loop
print "Repeating..."
keep [Condition]
4. Chapters (Functions)
Chapters are reusable blocks of code. Use addrun to execute them.
start chapter Greet
print "Hello!"
end chapter
addrun Greet
5. Background Tasks (Threads)
Run a chapter in another thread without blocking the main program.
Syntax: run background [ChapterName]
run background LoggingTask