-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathIRES.PAS
More file actions
99 lines (73 loc) · 1.79 KB
/
IRES.PAS
File metadata and controls
99 lines (73 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
unit IRES;
(* Information
ßßßßßßßßßßß
Program Title : Resource Manager
External name : IRES.TPU
Version : 1.3
Start update : 31/03/1997
Last update : 08/06/1999
Author : Rob Anderton
Description : Unit to initialise resource stream.
Bug fixed April '98
*)
{$O+,F+}
interface
uses Objects, DOS;
var ResFile : TResourceFile;
Stream : PBufStream;
procedure ResRegister;
{******}
implementation
uses App, Menus, Views, MsgBox, Dialogs, IEDIT, ICONTROL, Drivers;
{*** Internal function ***}
function StrFn(Num : longint) : string;
var S : string;
begin
Str(Num, S);
StrFn:= S;
end;
{*** Stream Error Handler ***}
procedure SError(var S : TStream); far;
var w : word;
Msg : string;
begin
case S.Status of
stError : Msg:= 'Error accessing file.';
stInitError : Msg:= 'Unable to initialise file.';
stReadError,
stGetError : Msg:= 'Error reading from file.';
stWriteError,
stGetError : Msg:= 'Error writing to file.';
else Msg:= 'Unknown file access error';
end;
if StatusLine = nil then
begin
ClearScreen;
writeln(Msg);
halt(1);
end;
w:= MessageBox(Chr(3) + Msg, nil, mfError+mfOKButton);
S.Reset;
end;
{******}
procedure ResRegister;
begin
RegisterMenus;
RegisterViews;
RegisterDialogs;
RegisterEditors;
RegisterType(RStringList);
RegisterType(RHintLine);
end;
{******}
var Temp : string;
D : DirStr;
N : NameStr;
E : ExtStr;
begin
StreamError:= @SError;
Temp:= FExpand(ParamStr(0));
FSplit(Temp, D, N, E);
Stream:= New(PBufStream, Init(D + 'NASMIDE.RES', stOpenRead, 1024));
ResFile.Init(Stream);
end.