Вверх ↑
Ответов: 963
Рейтинг: 12
#1: 2005-04-23 02:55:11 ЛС | профиль | цитата
Возможности внутреннего языка
IFPS3 поддерживает:

Переменные, константы
Стандартные конструкции:
[code:1]Begin/End If/Then/Else,
For/To/Downto/Do,
Case x Of,
Repeat/Until,
While,
uses,
Exit,
Continue,
Break [/code:1]Функции (объявленные внутри и "снаружи" скрипта)
Стандартные типы: Byte, Shortint, Char, Word, SmallInt, Cardinal, Longint, Integer, String, Real, Double, Single, Extended, Boolean, Array, Record, Enumerations
Классы, импортированные из Delphi
Вызов функций внешних библиотек (dll)
Важное замечание: IFPS3 не поддерживает типы Pointer и конструкцию class.

Примеры:
[code:1]Program IFSTest; var
i: Longint;
Begin
for i := 0 to 9 do
begin
writeln('hello'+inttostr(i));
end;
End.

Program IFSTest;
var
b: Byte;
Begin
for b := 0 to 2 do begin
case b of
0: writeln('0');
1: writeln('1');
else writeln('>1');
end;
end;
End.

Program IFSTest;
// compile the demo application, minimize delphi and run this.
function FindWindow(C1, C2: PChar): Longint; external 'FindWindowA@user32.dll stdcall';
function ShowWindow(hWnd, nCmdShow: Longint): Integer; external 'ShowWindow@user32.dll stdcall';
function SetWindowText(hWnd: Longint; Text: PChar): Longint; external 'SetWindowTextA@user32.dll stdcall';
var
i: Longint;
wnd: Longint;
Begin
wnd := Findwindow('', 'Innerfuse Pascal Script III');
SetWindowText(Wnd, 'This is DLL demo, it calls some windows user32 routines. This will hide this window for a few seconds');
for i := 0 to 200000 do begin end;
ShowWindow(Wnd, 0); // hide it
for i := 0 to 200000 do begin end;
SetWindowText(Wnd, 'Wasn''t that nice?');
ShowWindow(Wnd, 5); // show it
for i := 0 to 200000 do begin end;
SetWindowText(Wnd, 'Innerfuse Pascal Script III');
End.[/code:1]

Дополнительные особенности
IFPS3 - по сути интерпретатор Pascal. Но он может компилировать программы в своеобразный Pi-код, который выполняется на порядок быстрее, чем если бы он сразу проводил выполнение программы (просто интерпретировал).
карма: 0

0