-
-
Notifications
You must be signed in to change notification settings - Fork 1
Loops and Goto
a loop is a sequence of instructions that is continually repeated
Let's say you need to make a script that adds a number infinitely. you can use goto
for that here is a example
the code you want to loop:
{
+
;
}
here is how you add a loop:
{
+
;
goto
start
}
the goto \n start
will make the script run forever
you can even use goto with timers like this:
{
+
;
sleep
1000
goto
start
}
even you can exit the script by using:
{
+
goto
last
// this code will not run
;
}
-
For
Loop Syntax
for i=0; i-10; i=+1
// Code here
fo-end
i
stands for variable name. i-10
means 0 till 10
equivalent to i<10
in C. the i=+1
stands for increment i
by 1 equivalent to i++
in C
- For Loops are also castable Example:
for i={hexvar1}; i-{hexvar2}; i=+1
// Code here
fo-end
Copyright (C) S Pradosh 2023 - Closed Source Project
Architecture and OS that Melon Supports
Setup Melon Language for Windows Terminal
Setup Melon Language for VSCode Terminal
Setup Environment CLI for Melon Language on Windows
Copy Paste: [](https://github.com/pradosh-arduino/Melon-Language/)