Sanny Builder Syntax

First of all, what does syntax mean? I'm too dumb to explain it myself so i'll quote wikipedia  :trollface:

In linguistics, syntax is "the study of the principles and processes by which sentences are constructed in particular languages."

How does that relate to SB? Well, sanny can understand and compile code in two syntaxes;
- Low level coding/statements
- High level coding/statements

Low level is mostly relying on labels:)start, @start, jump @start, jf @start)
It's messy and hard to understand if you code is bigger or more complex.
It's also the way sanny outputs decompiled scripts.

Example;
r9gaWPy.png


High level is logical, simpler to use and easier with bigger and complex scripts. It also looks more clean.

Example;
95lbHWG.png



They basically work the same, there's nothing you can do in one and not the other. It all depends on how easier each one is for you. If you're new to cleo scripting i suggest using a mix of both.

Low level statements:


Code:
:label
Defines the name and start of the label.
Like said above low level is based on labels, so naming them is important, also you can't have more labels with the same name.

Code:
jump [member=23507]Label[/member]
Intrerupts the flow of the script by jumping to given label.
sZzEHgx.png


Code:
jf [member=23507]Label[/member]
else_jump [member=23507]Label[/member]
jump_if_false [member=23507]Label[/member]
Conditional check, to be used with a condition. If the condition is false then intrerupts the flow of the script and jump to given label.
PdihdbL.png



High level statements:

Code:
while true - end
Every script is one big loop, and can contain more loops, loopception.  :face_palm:
do i even make sense?  :dont_care:
You'll be using this for the main script mostly. It's a simple loop which repeats infinitely.
AXu9pYT.png


Code:
while - end
Conditional check, while condition is true repeat everything in a loop until condition is false.
Condition is read first, if condition is true the loop won't be executed.
ltgjgRd.png


Code:
repeat - until
Repeats everything in a loop until conditon is true.
CF25NPn.png


Code:
repeat - until true
The loop will only execute once.
Code:
repeat - until false
The loop will execute infinitely untill the loop is stopped.

Code:
if - then - else - end
You'll be using these a lot in your script. They're condition checks.
pTmiHnF.png


Code:
for - end
This will loop only for a number of iterations.
Code:
for var@ = <start val>  TO/DOWNTO <end val> step <n>
bv3I5P3.png


Code:
BREAK and CONTINUE
break - is used to break the current loop.
continue - is used to jump to the next condition check/iteration.
fR7RlNO.png

You can use break and continue in low level coding too;
Code:
jf BREAK
jf CONTINUE
BREAK and CONTINUE can be only used inside of a  loop.

Sorry for any mistakes, either code or grammar. Point them out in the comments and i will fix them.
 

DzkAy

Well-known member
Joined
Feb 20, 2014
Messages
472
Reaction score
1
WOW Springfield finally made a TUTORIAL !!  :somuchwin:
 

maximko

Well-known member
Joined
Apr 16, 2014
Messages
394
Reaction score
1
Location
Russia
Thanks man im starting a new CLEO!
But it will realease on 2015
 

ThermaL

Expert
Joined
Oct 23, 2013
Messages
1,593
Reaction score
3
That's what I call an useful tutorial!
FK you blackhat! :lol:
 

blackHat

Expert
Joined
Jul 28, 2013
Messages
930
Reaction score
2
[member=111]springfield[/member]  nice , good work bro :)

i'm happy you niggers finally decided to do something useful instead of just swagging  :eek:h_stop_it_u:

TH3RM4L link said:
That's what I call an useful tutorial!
FK you blackhat! :lol:
:eek:key:
 

Fu$10N

Expert
Joined
Mar 5, 2014
Messages
1,101
Reaction score
9
It's like coding in C# and C++  :somuchwin: GoodJob :urtheman:
 

Mennims

Active member
Joined
Mar 18, 2014
Messages
41
Reaction score
0
I can't compile my code if I use Break and continue in it. I get an unknown directive error. Any idea how to fix this?
 

Mennims

Active member
Joined
Mar 18, 2014
Messages
41
Reaction score
0
springfield said:
springfield said:
BREAK and CONTINUE can be only used inside of a  loop.

Mennims said:
I can't compile my code if I use Break and continue in it. I get an unknown directive error. Any idea how to fix this?

I did use it inside a loop. I tried typing it in a while loop but again I get the same error
 
Top