English Amiga Board


Go Back   English Amiga Board > Support > support.Apps

 
 
Thread Tools
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  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
A few questions Muzer project.ClassicWB 10 12 September 2009 14:14
C/C++ questions pmc Coders. General 26 22 May 2007 03:22
Three Little Questions. mindjoker support.Hardware 2 16 March 2003 03:38
Two questions Drakon request.Old Rare Games 7 19 November 2002 19:33
A few questions! One1 New to Emulation or Amiga scene 2 30 October 2002 17:41

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:50.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.25847 seconds with 15 queries