Results 1 to 6 of 6

Thread: Question about Scar (well I guess Pascal) syntax

  1. #1
    Join Date
    Nov 2008
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Question about Scar (well I guess Pascal) syntax

    Why do you have to put a name at the top of every program in SCAR/Pascal? This is probably a stupid question but I've never seen any other programming language do this; shouldn't the name just be the filename?

  2. #2
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    That's just the program name. I don't know about in other programming languages, but it's roughly equivalent to Java's syntax of:
    class Name
    {
    }

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

    Default

    Well, I have a theory...

    The computer does not run off of scar code directly. In fact, any programing language translates the language into binary before it uses it. This is known as compiling. This changes the file into a .exe file.

    Scar is made from a different programming language. So SCAR is translated into that programming language and then into binary. Because the whole SCAR program (that you type your script into and compiles you script) is scripted itself, it does not start a brand new program when you run the Scar script. Rather, it executes a function that is your script. I assume that this function is named the name of the of the program.

    Fake edit: actually, Freddy1990 could have just pre-named the user entered program... its probably for practical reasons of which i have no idea

  4. #4
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    Quote Originally Posted by Macrosoft View Post
    Well, I have a theory...

    The computer does not run off of scar code directly. In fact, any programing language translates the language into binary before it uses it. This is known as compiling. This changes the file into a .exe file.
    Not really, the scripting engine translates it to some kind of bytecode internally, in RAM, which it then processes.
    Scar is made from a different programming language. So SCAR is translated into that programming language and then into binary. Because the whole SCAR program (that you type your script into and compiles you script) is scripted itself, it does not start a brand new program when you run the Scar script. Rather, it executes a function that is your script. I assume that this function is named the name of the of the program.
    Nope, the name of the main procedure is !Main actually Try it:
    SCAR Code:
    program test;
    var v : tvariantarray;
    begin
    writeln('lolzors');
    threadsafecall('!Main', v);
    end.

    Why it is there? Probably due to '60s stuff.
    I made a new script, check it out!.

  5. #5
    Join Date
    Nov 2008
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Markus View Post
    Not really, the scripting engine translates it to some kind of bytecode internally, in RAM, which it then processes.

    Nope, the name of the main procedure is !Main actually Try it:
    SCAR Code:
    program test;
    var v : tvariantarray;
    begin
    writeln('lolzors');
    threadsafecall('!Main', v);
    end.

    Why it is there? Probably due to '60s stuff.
    Yeah that's what I thought too.. C and assembly and stuff all seem to just use a generic "main" function, there isn't really any reason to name it..

    What do you mean by 60's stuff?

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

    Default

    Oh, I thought SCAR was a continuous program that ran a function that you wrote in box when you clicked run. I guess it runs a separate program with its own main function.

    Or I am making no sense at all...I havent scripted in about half a year...

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Logical operators in Scar/Pascal
    By tojoh in forum OSR Help
    Replies: 3
    Last Post: 06-03-2008, 02:30 PM
  2. Replies: 5
    Last Post: 02-26-2008, 04:14 PM
  3. is it Scar, Pascal or Me?
    By man slaughter in forum OSR Help
    Replies: 3
    Last Post: 02-18-2008, 10:01 AM

Posting Permissions

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