SRL Archive - OSR Beginner Scripting Tutorials

Guide to having perfect standards!


rj

2013-03-12 16:30:53

This is going to be a fairly simple guide on how to have perfect standards!

First of all, standards are ummm.. well the way your code is written.

Example of bad standards:

Program S;
Procedure HelloWorld;
Begin
Writeln('hello')
Begin
Writeln('hello hi')
End;
End;
Begin
HelloWorld;
End.

Example of good standards:

program S;

procedure HelloWorld;
begin
Writeln('hello')
begin
Writeln('hello hi')
end;
end;

begin
HelloWorld;
end.

Now how to do it via the extension:

Step 1) Go to Simba —> View —-> Extensions, and enable formatter.sex


Step 2) Now, to make your script look good go to parser —> Format script


Now your done! It is best that you learn how to use proper standards yourself without the extension, but if your just stuck it's better to use it then releasing a hard-to-read script! The secret to doing this is hitting "tab" after each begin and making sure each End; maches up with Begin!Post below if you have any questons

sinking

2013-03-13 11:30:57

Never knew there was an automatic formatter, thanks for the tip!

Sjoe

2013-03-13 11:34:58

Lol never knew off the formatter :)

litoris

2013-03-13 11:36:54

LOL I thought this was a complete guide before opening the thread, so I was just gonna troll it by saying Parser>Format script, but turns out that's the guide itself.

SomeGuyFromHere

2013-03-15 16:05:32

It deleted all comments in the code, making it very difficult to change things afterwards, especially if its a long script. Good standarts are fine but good looking isn't always the thing to go for… at least the result looks cryptic to me.