Page 3 of 3 FirstFirst 123
Results 51 to 57 of 57

Thread: [Release] SCAR Titan 4.00 Pre-Alpha

  1. #51
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    kick ass!

  2. #52
    Join Date
    Oct 2006
    Posts
    1,211
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Just did some benchmarks with reflection based stuff for kicks and giggles. I have to say I'm quite impressed. The script I ran was 1,000,000 calls to SmartGetFieldInt(0, 'jba.a');

    Simba Code:
    MarkTime(T);

      for I := 1 to 1000000 do
      begin
        LoginIndex := SmartGetFieldInt(0, 'jba.a');
      end;

      T := TimeFromMark(T);
      Writeln('Total Time: '+ToStr(T));
    SCAR Code:
    T := Time.SysTime;

      for I := 1 to 1000000 do
      begin
        LoginIndex := SmartGetFieldInt(0, 'jba.a');
      end;

      T := Time.SysTime - T;
      Print('Total Time: '+Types.ToStr(T));

    Results:

    Simba Code:
    Starting Test.
    Total Time: 9329
    Successfully executed.
    SCAR Code:
    Starting test...
    Total Time: 4836
    Script finished (6848ms)
    Extinct.

    Formally known as Drags111.

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

    Default

    I've added implicit typecasting of TPoint to string now So aside from using ToStr you can also do this:

    SCAR Code:
    uses
      Types;
    var
      s: string;
    begin
      s := Point(5, 5);
      PrintLn(s);
    end.

    Code:
    Succesfully compiled (15ms)
    (5,5)
    Script finished (0ms)

  4. #54
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Freddy1990 View Post
    I've added implicit typecasting of TPoint to string now So aside from using ToStr you can also do this:

    SCAR Code:
    uses
      Types;
    var
      s: string;
    begin
      s := Point(5, 5);
      PrintLn(s);
    end.

    Code:
    Succesfully compiled (15ms)
    (5,5)
    Script finished (0ms)
    That just seems a bit unclear. I feel like a better option would he having it work like the `print` function in python:
    python Code:
    print "hi", "i'm", "a spaced out string.", 3

    So having the unlimited accepted parameters then allow one to specify the separator between them. Just a thought

    None of the ambiguity of the implicit casting.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

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

    Default

    You can still use ToStr...

  6. #56
    Join Date
    Jan 2008
    Location
    10° north of Hell
    Posts
    2,035
    Mentioned
    65 Post(s)
    Quoted
    164 Post(s)

    Default

    Quote Originally Posted by Nava2 View Post
    So having the unlimited accepted parameters then allow one to specify the separator between them. Just a thought
    This is a great idea, Freddy if you take a look at Lape you can see how niels did it.

    Dg's Small Procedures | IRC Quotes
    Thank Wishlah for my nice new avatar!
    Quote Originally Posted by IRC
    [22:12:05] <Dgby714> Im agnostic
    [22:12:36] <Blumblebee> :O ...you can read minds

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

    Default

    Parsing the syntax isn't much of a problem, integrating it into the engine is...

    EDIT: Explicit typecasting of TPoint to string now also works:

    SCAR Code:
    uses Types;
    begin
      PrintLn(string(Point(5, 5)));
    end.

    EDIT2: Now the asbtract, sealed, final and absolute keywords are also available check the release thread for examples.
    Last edited by Freddy1990; 07-29-2011 at 08:34 AM.

Page 3 of 3 FirstFirst 123

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
  •