Results 1 to 5 of 5

Thread: variable or type .create

  1. #1
    Join Date
    Feb 2008
    Posts
    517
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default variable or type .create

    hey, just tried to run an example code in simba handbook and the example code wont compile for me, anyone give me points as to why its not working? i mean its in simbas documentation so im assuming something is wrong with my simba and not the code... anyways, this is the code and follows the syntax error.

    Code:
    program new;
    var
      Font : TFont;
    begin
      Font := TFont.Create;
      Font.Name := 'Courier New';
      Font.Size := 10;
      Font.Style := [];
      LoadSystemFont(Font,'test');
      DisplayDebugImgWindow(0,0);
      DisplayDebugImgWindow(150,50);
      DrawBitmapDebugImg(BitmapFromText('BMP[0] has not been freed','test'));
      Font.free;
    end.
    Error: Unknown declaration "Create" at line 5
    Compiling failed.

  2. #2
    Join Date
    Jun 2015
    Posts
    36
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    It doesn't look like that documentation has been updated since Simba switched from PascalScript to Lape. The following code should be the equivalent of what is in the docs (except for lape):
    Simba Code:
    program new;
    var
      Font : TFont;
    begin
      Font.Init;
      Font.setName('Courier New');
      Font.setSize(10);
      Font.setStyle([]);
      LoadSystemFont(Font,'test');
      DisplayDebugImgWindow(0,0);
      DisplayDebugImgWindow(150,50);
      DrawBitmapDebugImg(BitmapFromText('BMP[0] has not been freed','test'));
      Font.free;
    end.

    EDIT: Yeah, the doc example compiles under Simba 1.2 if you switch the interpreter to PS. This is no longer an option in 1.3 so you gotta go with the Lape version.
    Last edited by daileyj93; 03-08-2019 at 02:52 PM.

  3. #3
    Join Date
    Feb 2008
    Posts
    517
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Okay, cool thanks that works, I got another question for ya, how do I import the full function list to simba?

    the other day I was trying to work with an array and couldnt find set array length function on the function list, then I guessed it and it worked, but im assuming theres many other functions that wont appear but would compile and its really limiting my resources

  4. #4
    Join Date
    May 2012
    Location
    Glorious Nippon
    Posts
    1,011
    Mentioned
    50 Post(s)
    Quoted
    505 Post(s)

    Default

    Quote Originally Posted by Feroc1ty View Post
    Okay, cool thanks that works, I got another question for ya, how do I import the full function list to simba?

    the other day I was trying to work with an array and couldnt find set array length function on the function list, then I guessed it and it worked, but im assuming theres many other functions that wont appear but would compile and its really limiting my resources
    There are some 'magic functions' that won't pop up with a code completion hint.
    Here are some docs that might help. http://docs.villavu.com/simba/scriptref/lape.html
    You can also just search for the Free Pascal equivalent most of the time. https://www.freepascal.org/docs-html...setlength.html

  5. #5
    Join Date
    Feb 2008
    Posts
    517
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Thanks for the pascal link, really appreciate it!

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
  •