Page 2 of 2 FirstFirst 12
Results 26 to 40 of 40

Thread: SRL/Simba Standards (with examples)

  1. #26
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    How about adding a sentence on what are standards? 'Standards are a set of standardized guidelines for formatting your code, so that you and others will be able to read it more clearly.' or something like that. Maybe also mention that in other languages spacing and indenting affects the code.

  2. #27
    Join Date
    Mar 2007
    Posts
    1,700
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    IMO indentation is the only thing that matters. Everything else is personal preference.

  3. #28
    Join Date
    Aug 2008
    Location
    Oklahoma, USA
    Posts
    173
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    for const and var, would something like this be acceptable?

    const
    nameOfSomething = 30;

  4. #29
    Join Date
    Mar 2006
    Location
    Behind you
    Posts
    3,193
    Mentioned
    61 Post(s)
    Quoted
    63 Post(s)

    Default

    This is the correct way to do that statement.

    Code:
    const
      NameOfSomething = 30;

    "Sometimes User's don't need the Answer spelled out with Code. Sometimes all they need is guidance and explanation of the logic to get where they are going."

  5. #30
    Join Date
    Aug 2008
    Location
    Oklahoma, USA
    Posts
    173
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    Quote Originally Posted by BraK View Post
    This is the correct way to do that statement.

    Code:
    const
      NameOfSomething = 30;
    OK then, I will do it that way. I am just use to using Visual Studio (C++,C#,etc), but this will not be a hard switch to do.
    Last edited by sf411; 09-13-2011 at 01:42 PM.

  6. #31
    Join Date
    Sep 2011
    Location
    Earth
    Posts
    63
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Code:
    program loopy;
    
    var
      i: Integer;
      s: string;
    
    begin
    for  i := 0  to 3 do
      if i = 3 then
        Writeln('i = 3')
       else
        Writeln(i);
      repeat
        Writeln(s);
      until(s = '');
    end.
    meh... lol

  7. #32
    Join Date
    Apr 2007
    Location
    Lithuania
    Posts
    384
    Mentioned
    0 Post(s)
    Quoted
    15 Post(s)

    Default

    I learned much from this a few months a ago, thank you; )

  8. #33
    Join Date
    Jan 2013
    Posts
    36
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Thanks, helped me alot .

  9. #34
    Join Date
    Mar 2013
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Random question can't find solution of this :
    const
    x, aInteger, run, invCounter, runIsOn, thaTime, TreeColor3, y, z, logs, level, knife, TreeColor, TreeColors: integer;
    Please help thanks

  10. #35
    Join Date
    Sep 2008
    Posts
    754
    Mentioned
    8 Post(s)
    Quoted
    275 Post(s)

    Default

    These are the official standards, correct? not just personal preferences, from other topics i saw that SRL looks for people that are more capable of scripting - than polishing.

    Regardless i think both are very important.

  11. #36
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Official as in set out by kaitnieks (the creator of scar) in 2004, yes.

    Scriptability is much more important and standards, but people are going to have trouble reading your script if there are no standards as it will be hard to see where one bit ends and another starts

    Plus having a universal look and feel is easier to learn

    for example, most iOS apps share the design from the OS its self, because its a universal design and fits and looks well with everything, if there was no standards for design everything would look completely different.

    ~shut
    Last edited by Shuttleu; 04-30-2013 at 12:57 PM.

  12. #37
    Join Date
    Feb 2013
    Posts
    465
    Mentioned
    6 Post(s)
    Quoted
    221 Post(s)

    Default

    This is useful, however where you talk about procedures/functions you mention that they start capitalized and then are camelCased; is this not the suitably named PascalCase?

  13. #38
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Quote Originally Posted by wthomas View Post
    This is useful, however where you talk about procedures/functions you mention that they start capitalized and then are camelCased; is this not the suitably named PascalCase?
    Yes, you are right
    2.5 years and your the first to spot it

    ~shut

  14. #39
    Join Date
    May 2012
    Location
    Brazil, Rio de Janeiro.
    Posts
    160
    Mentioned
    2 Post(s)
    Quoted
    32 Post(s)

    Default

    Nice tut Updated scripts now, I only kept with my universal vars >.<

  15. #40
    Join Date
    Oct 2013
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Thanks ill try to use this info

Page 2 of 2 FirstFirst 12

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
  •