home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
300-399
/
ff339.lzh
/
PCQ
/
Runtime.lzh
/
Runtime
/
Extras
/
ConsoleIO.p
next >
Wrap
Text File
|
1989-10-21
|
2KB
|
70 lines
External;
{
ConsoleIO.p
This file implements all the normal console.device stuff for
dealing with windows. The first set of routines is standard Amiga stuff,
culled from the ROM Kernel Manual. The last few routines partially mimic
similar routines from Turbo Pascal. See ConsoleTest.p for an example of
using these routines.
}
{$I "Include/Exec.i"}
{$I "Include/Ports.i"}
{$I "Include/ExecIO.i"}
Procedure ConPutChar(Request : IOStdReqPtr; Character : Char);
var
Error : Integer;
begin
Request^.ioReq.ioCommand := CMD_WRITE;
Request^.ioData := Adr(Character);
Request^.ioLength := 1;
Error := DoIO(IORequestPtr(Request));
end;
Procedure ConWrite(Request : IOStdReqPtr; Str : String; length : Integer);
var
Error : Integer;
begin
Request^.ioReq.ioCommand := CMD_WRITE;
Request^.ioData := Str;
Request^.ioLength := Length;
Error := DoIO(IORequestPtr(Request));
end;
Procedure ConPutStr(Request : IOStdReqPtr; Str : String);
var
Error : Integer;
begin
Request^.ioReq.ioCommand := CMD_WRITE;
Request^.ioData := Str;
Request^.ioLength := -1;
Error := DoIO(IORequestPtr(Request));
end;
Procedure QueueRead(Request : IOStdReqPtr; Where : String);
begin
Request^.ioReq.ioCommand := CMD_READ;
Request^.ioData := Where;
Request^.ioLength := 1;
SendIO(IORequestPtr(Request));
end;
Function ConGetChar(consolePort : MsgPortPtr; Request : IOStdReqPtr;
WhereTo : String) : Char;
var
Temp : Char;
TempMsg : MessagePtr;
begin
if GetMsg(consolePort) = Nil then begin
TempMsg := WaitPort(consolePort);
TempMsg := GetMsg(consolePort);
end;
Temp := WhereTo^;
QueueRead(Request, WhereTo);
ConGetChar := Temp;
end;