но можете посмотреть ИК.
DLL - можно найти в этом архиве
ST_LEVEL_LAB.rar
Add(InlineCode,9417149,204,79)
{
WorkPoints=#9:SetScript|6:doComp|
EventPoints=#10:onCompName|9:onCompRes|
VarPoints=#6:Errors|
DataPoints=#5:IntAr|7:ArCount|
Code=#0:|15:unit HiAsmUnit;|0:|9:interface|0:|21:uses kol,Share,Debug;|0:|4:type|32: {Описания вннешних переменных}|28: RExpVar=packed Record|27: VarName:String[80];|27: VarType:String[60];|28: VarInit:ShortString;|11: end;|27:{Описания внешних процедур}|0:|29: RImpProc=packed Record|29: ProcStr :ShortString;|29: ProcInc :ShortString;|25: ProcAddr:Pointer;|11: end;|0:|35: TPasScriptAbstract=class(TObject)|21: EVarList:TList;|22: IProcList:TList;|25: constructor Create;|39: Procedure Clear;Virtual;Abstract;|75: Function CompleTest(const Script: string): boolean; Virtual;Abstract;|60: Procedure AddExtVar(VN,VT,VI:String);Virtual;Abstract;|60: Function GetOutVar(VN:String):String;Virtual;Abstract;|69: Procedure AddExtProc(PS,PI:String;Pa:Pointer);Virtual;Abstract;|75: Function ExecScript(const Script: string): boolean;Virtual; Abstract;|8: end;|0:|15:{Главный класс}|0:|28: THiAsmClass = class(TDebug)|10: private|0:|9: public|16:{ Arr :PArray;}|21: Script,ERR:String;|25: PS:TPasScriptAbstract;|14: IX:Integer;|16:{ Event Points }|35: onCompName,onCompRes : THI_Event;|15:{ Data Points }|32:IntAr, ArCount, ArC : THI_Event;|0:|15:{ Work Points }|50:Procedure SetScript (var _Data:TData; Index:word);|47:Procedure doComp (var _Data:TData; Index:word);|0:|14:{ Var Points }|47:Procedure Errors (var _Data:TData; Index:word);|19:Constructor Create;|0:|4:end;|0:|14:implementation|3:Var|13: Arr :PArray;|20: ShellK:THiAsmClass;|43: constructor TPasScriptAbstract.Create;|7: begin|6: end;|0:|67:Function CreatePSClass:TPasScriptAbstract; external 'MyPS_Lib.dll';|31:Constructor THiAsmClass.Create;|6: begin|23: Ps:= CreatePSClass;|5: end;|15:{ Work Points }|63:Procedure THiAsmClass.SetScript (var _Data:TData; Index:word);|24:Procedure MSG(S:STring);|5:begin|18: ShowMessage(S)|4:end;|0:|39:Function GetIntAr(Ind:Integer):Integer;|3:var|13: FItem:TData;|12: Ind2:TData;|5:begin|21: Ind2:=_DoData(ind);|16:If Arr<>nil then|29: if Arr._Get(Ind2,FItem) then|47: GetIntAr:=ToInteger( FItem) else GetIntAr:=-1;|4:end;|28:Function GetArCount:Integer;|5:begin|16:If Arr<>nil then|24: GetArCount:=Arr._Count;|4:end;|34:Procedure CompOn(Name,Res:String);|5:begin|38: _hi_OnEvent(ShellK.onCompName,Name);|35: _hi_OnEvent(ShellK.onCompRes,Res)|4:end;|0:|5:Begin|9:Ps.Clear;|16: ShellK:=Self ;|55: Ps.AddExtProc('Procedure MSG(S:STring);','MSG',@MSG);|80: Ps.AddExtProc('Function GetIntAr(Ind:Integer):Integer;','GETINTAR',@GetIntAr);|73: Ps.AddExtProc('Function GetArCount:Integer;','GETARCOUNT',@GetArCount);|71: Ps.AddExtProc('Procedure CompOn(Name,Res:String);','COMPON',@CompOn);|9: IX:=0;|27: Script :=ToString(_Data);|32: If ps.CompleTest( Script) then|30: ERR:='' else ERR:= 'Error';|4:end;|60:Procedure THiAsmClass.doComp (var _Data:TData; Index:word);|0:|5:Begin|26: Arr := ReadArray(IntAr);|36: If Ps. ExecScript( Script ) then|39: ERR:='' else ERR:= 'Run time Error';|0:|4:end;|0:|14:{ Var Points }|59:Procedure THiAsmClass.Errors (var _Data:TData; Index:word);|5:Begin|0:|25: _Data:=_DoData ( Err ) ;|4:end;|0:|4:end.|
}