Changeset 65 for branches/Independent/Apps.pas
- Timestamp:
- Oct 9, 2024, 9:14:47 PM (13 days ago)
- Location:
- branches/Independent
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Independent
-
Property svn:ignore
set to
lib
Independent
Independent.lps
Independent.res
-
Property svn:ignore
set to
-
branches/Independent/Apps.pas
r64 r65 32 32 begin 33 33 with Context.Api do begin 34 PrintHelloWorld;34 WriteLine('Hello World!'); 35 35 Sleep(OneSecond); 36 36 RunApp('Code'); … … 49 49 Name := 'Code'; 50 50 Code := TStringList.Create; 51 Code.Add('PrintHelloWorld');52 51 end; 53 52 … … 62 61 I: Integer; 63 62 Line: string; 63 Command: string; 64 Index: Integer; 64 65 begin 65 66 I := 0; 66 67 while (I >= 0) and (I < Code.Count) do begin 67 Line := Code[I] ;68 Line := Code[I].Trim; 68 69 Inc(I); 69 if Line = 'PrintHelloWorld' then Context.Api.PrintHelloWorld; 70 if Line = '' then Continue; 71 72 Index := Pos(' ', Line); 73 if Index > 0 then begin 74 Command := Copy(Line, 1, Index - 1); 75 Delete(Line, 1, Index); 76 end else begin 77 Command := Line; 78 Line := ''; 79 end; 80 if Command = 'WriteLine' then Context.Api.WriteLine(Line) 81 else if Command = 'Sleep' then Context.Api.Sleep(StrToInt(Line)) 82 else if Command = 'RunApp' then Context.Api.RunApp(Line) 83 else raise Exception.Create('Unsupported command ' + Command); 70 84 end; 71 85 end;
Note:
See TracChangeset
for help on using the changeset viewer.