SRL Archive - OSR Help

TFont.Create gives me an error.


Gavril

2013-11-25 05:08:44

Attempting to follow something written in the Documentation under OCR, I copy+pasted the script for LoadSystemFont and recieved the following error:
Exception in Script: Unknown declaration "Create" at line 5, column 16


http://docs.villavu.com/simba/scriptref/ocr.html

Or simply, here's the script:

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.

bonsai

2013-11-25 07:27:57

I'm guessing the docs are out of date. I hashed out this version by checking the SRL6 code for TFont usage.

program new;
var
Font : TFont;
begin
Font.init();
Font.setName('Courier New');
Font.setSize(10);
// Font.Style := [];
LoadSystemFont(Font,'test');
DisplayDebugImgWindow(0,0);
DisplayDebugImgWindow(150,50);
DrawBitmapDebugImg(BitmapFromText('BMP[0] has not been freed','test'));
Font.free;
end.

Gavril

2013-11-25 20:49:21

From: bonsai
I'm guessing the docs are out of date. I hashed out this version by checking the SRL6 code for TFont usage.

program new;
var
Font : TFont;
begin
Font.init();
Font.setName('Courier New');
Font.setSize(10);
// Font.Style := [];
LoadSystemFont(Font,'test');
DisplayDebugImgWindow(0,0);
DisplayDebugImgWindow(150,50);
DrawBitmapDebugImg(BitmapFromText('BMP[0] has not been freed','test'));
Font.free;
end.


I assumed as much as well, but wasn't sure where to look for TFont usage (been ages since I used SRL/etc).

Tyvm for your assistance!

bg5

2013-11-28 19:07:01

Docs are written for PascalScrip and you are using Lape, that's why.