View Single Post
Old 19 August 2009, 17:49   #1
olesio
Registered User
 
Join Date: Apr 2007
Location: Poland
Posts: 337
Few questions about HSPascal [solved]

Hello. I edit this post because I solved all my problem with HSPascal. Here is solution for
all of them. I know it is old language but maybe someone other also need example code.

The begining of program.
Code:
program test;
uses
  AmigaDOS, Dos, Exec, Utility;
var
  Cmd : string;
  TagArray : Array[0..6] of TTagItem;
  Res : integer;
  FileName : string;
  Ok : boolean;
begin
To run a file or command
Code:
  Cmd := 'assign T: Ram:' +#0;
  TagArray[0].Ti_Tag := SYS_Asynch;
  TagArray[0].Ti_Data := 0;
  TagArray[1].Ti_Tag := SYS_Input;
  TagArray[2].Ti_Tag := NP_StackSize;
  TagArray[2].Ti_Data := 0;
  TagArray[3].Ti_Tag := NP_Priority;
  TagArray[3].Ti_Data := 0;
  TagArray[4].Ti_Tag := SYS_Output;
  TagArray[4].Ti_Data := 0;
  TagArray[5].Ti_Tag := SYS_UserShell;
  TagArray[5].Ti_Data := True_;
  TagArray[6].Ti_Tag := TAG_end;
  Res := SystemTagList(@Cmd[1], @TagArray);
To delete file
Code:
  FileName := 'Dir:Filename.exe';
  Ok := DeleteFile(@FileName[1]);
To make 3000 miliseconds delay - know in Object Pascal as Sleep:
Code:
  Delay(3000);
Geting env variable is not needed because we can handle program command line parameters
like in most of Pascal Compilers do using ParamStr(1) etc or all Parameters in ParamCount
Code:
   if (ParamStr(1) = '') then
    begin
      Halt;
    end;

Last edited by olesio; 20 August 2009 at 05:02. Reason: Solved my problems :)
olesio is offline  
AdSense AdSense  
 
Page generated in 0.08379 seconds with 9 queries