# Thread: variable or type .create

1. SRL Junior Member
Join Date
Feb 2008
Posts
517
Mentioned
0 Post(s)
Quoted
1 Post(s)

## 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 := [];
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. SRL Junior Member
Join Date
Jun 2015
Posts
36
Mentioned
0 Post(s)
Quoted
5 Post(s)
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. SRL Junior Member
Join Date
Feb 2008
Posts
517
Mentioned
0 Post(s)
Quoted
1 Post(s)
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. Originally Posted by Feroc1ty
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. SRL Junior Member
Join Date
Feb 2008
Posts
517
Mentioned
0 Post(s)
Quoted
1 Post(s)
Thanks for the pascal link, really appreciate it!