Results 1 to 11 of 11

Thread: Capitals or No Capitals?

  1. #1
    Join Date
    Jul 2007
    Location
    England
    Posts
    86
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default [SOLVED]Capitals or No Capitals?

    Hello SRLers!

    I am having trouble with standards. Ok so I have my code like this :

    SCAR Code:
    // Credits - WhoCares357 ( Idea for Example In Beginner Tutorial )

    program QuestionExample;

    procedure WriteSomethingRandom;
    begin
      Writeln('Hulp Lol!');
    end;

    procedure StayForABit;
    begin
      WriteSomethingRandom;
       Wait(1000);
    end;

    begin
      StayForABit;
    end.

    However, I have looked at someones script, say like Wizzups or _ChArMz

    They do it like so :

    SCAR Code:
    // Credits - WhoCares357 ( Idea for Example In Beginner Tutorial )

    Program QuestionExample;

    Procedure WriteSomethingRandom;
    Begin
      WriteLn('Hulp Lol!');
    End;

    Procedure StayForABit;
    Begin
      WriteSomethingRandom;
       Wait(1000);
    End;

    begin
      StayForABit;
    end.

    So basicallyl, Do I use the Capital way or the Non Capital way, if it is personal preference, what looks best to you?

    Thank you for your time.

    -Nitro

  2. #2
    Join Date
    May 2006
    Location
    Helsinki, Finland (capital)
    Posts
    269
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well i guess its your choice but i prefer no capitals, but atmost i hate if there is capitals and non capitals together, but your choice, whichever you like more!

  3. #3
    Join Date
    Jul 2007
    Location
    England
    Posts
    86
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for the quick response Eicca, I think I like lower capitals aswell. I can now continue with my up and coming script

    Thanks again.

    -Nitro

  4. #4
    Join Date
    Feb 2006
    Location
    London, England
    Posts
    2,045
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default

    generally, all bold words should be lowercase.

    PHP Code:
    procedure
    function
    begin
    end
    var
    repeat
    until
    while
    to
    do
    for
    goto
    label
    string
    type
    record
    etc

    and all identifiers should be capitalized

    PHP Code:
    Integer
    Boolean
    Varient 
    including function/procedure names

    PHP Code:
    function ThisIsANewFunctionBoolean;
    procedure GoodMorning(YesBooleanResponsestring); 
    And the scripting standards above indentation wise are a bit off.

    NO NO NO!
    PHP Code:
    function New: Boolean;
    var
      
    IInteger;
    begin
      Writeln
    ('New')
        
    Writeln('New Again!');
           For 
    := 0 to 10 do
             
    Begin
              Writeln
    (IntToStr(i));
                 
    end;
                    
    Result := True;
    end
    YES YES YES!
    PHP Code:
    function New: Boolean;
    var
      
    IInteger;
    begin
      Writeln
    ('New');
      
    Writeln('New Again!');
      For 
    := 0 to 10 do
      
    begin
        Writeln
    (IntToStr(i));
      
    end;
      
    Result := True;
    end
    Personally, I capitalize the bold functions which are "Openers", E.G Procedure, Function, Begin, Repeat etc. and lowercase the "Closers" E.G. until, end etc.

    A strange way to do it yes, i know
    SRL Wiki | SRL Rules | SRL Stats
    Ultimate SCAR Scripting Tutorial | Starblaster100's Auth System | Join the official SRL IRC now!


    Help Keep SRL Alive! Please disable Advert Blockers on SRL! Help Keep SRL Alive!


  5. #5
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Is there any reason why 'string' is bolded and 'integer' is not?

  6. #6
    Join Date
    Jul 2007
    Location
    England
    Posts
    86
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks Starblaster!

    Thats a really useful post <3 =]
    This has made a lot of things clearer for me and I will be sure to use lower case when needed and upper case when needed

    -Nitro

    P.S I guess my question has been answered so;

    SOLVED =]

  7. #7
    Join Date
    Feb 2006
    Location
    London, England
    Posts
    2,045
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default

    There is a reason, but i can't remember it :S

    No problem Nitro
    SRL Wiki | SRL Rules | SRL Stats
    Ultimate SCAR Scripting Tutorial | Starblaster100's Auth System | Join the official SRL IRC now!


    Help Keep SRL Alive! Please disable Advert Blockers on SRL! Help Keep SRL Alive!


  8. #8
    Join Date
    Jul 2007
    Location
    UK
    Posts
    307
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by ZephyrsFury View Post
    Is there any reason why 'string' is bolded and 'integer' is not?

    Hes using PHP tags and not Scar tags :P

  9. #9
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    String is bolded in SCAR aswell...

  10. #10
    Join Date
    Feb 2006
    Location
    Belgium
    Posts
    3,137
    Mentioned
    3 Post(s)
    Quoted
    5 Post(s)

    Default

    No capitals, plz, throw a blanket over that one with capitals or something, it hurts my eyes -_-

    And string is the only type that is supposed to be written without caps as it's bold

  11. #11
    Join Date
    Feb 2006
    Location
    London, England
    Posts
    2,045
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default

    Ah, my bad lol, didn't know that.

    I've now decided to script all my scripts as follows

    PHP Code:

    PROGRAM 
    NEW;

    PROCEDURE KILL_FREDDY;
    VAR
      
    IINTEGER;
    BEGIN
      WRITELN
    ('OMFG IM SHOUTING!');
      
    WRITELN(INTTOSTR(I));
      
    WRITELN('FREDDDDDDDDDDDDDDDDYYYYYYYYY!');
      
    WRITELN('<3');
    END;

    BEGIN
      KILL_FREDDY
    ;
    END
    hows that?
    SRL Wiki | SRL Rules | SRL Stats
    Ultimate SCAR Scripting Tutorial | Starblaster100's Auth System | Join the official SRL IRC now!


    Help Keep SRL Alive! Please disable Advert Blockers on SRL! Help Keep SRL Alive!


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •