home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Garbo
/
Garbo.cdr
/
mac
/
sound
/
chaneler.sit
/
Channelizer.ƒ
/
ResUtil.p
< prev
next >
Wrap
Text File
|
1989-09-08
|
2KB
|
102 lines
unit ResUtil;
{ Copyright ⌐ 1989 Chris Muir, Entropy Engineering. }
{ Internet: (hplabs,pacbell,ucbvax,apple) !well!cbm }
{ Pan: ZMS }
{ US Mail: 360 Elizabeth St. San Francisco, CA 94114 }
{+++++++++++++++++++++++ History +++++++++++++++++++++++}
{ 0.0a ╩July 27, 1989 cbm}
{ brand spanking new }
interface
function WasResErr (theRoutine: str255): boolean;
implementation
const
rResErrDlg = 11;
iUmHmm = 1;
{_____________________ ResErrDialog _____________________}
procedure ResErrDialog (Msg1, Msg2: str255);
var
tempRect: Rect;
itemType: Integer;
item: Handle;
itemHit: Integer;
theDialog: DialogPtr;
ByeBye: boolean;
begin
theDialog := GetNewDialog(rResErrDlg, nil, Pointer(-1)); { grab that puppy }
paramText(Msg1, Msg2, '', ''); { Speak }
ShowWindow(theDialog);
SelectWindow(theDialog);
ByeBye := false;
repeat { do that dialog }
ModalDialog(nil, itemHit);
GetDItem(theDialog, itemHit, itemType, item, tempRect);
if (itemHit = iUmHmm) then
begin
ByeBye := TRUE;
end;
until ByeBye; { done w/ bragging }
DisposDialog(theDialog); { so flush it }
end; { ResErrDialog }
{_____________________ WasResErr _____________________}
function WasResErr (theRoutine: str255): boolean;
var
myErr: integer;
begin
myErr := ResError;
if myErr <> noErr then
begin
WasResErr := true;
case myErr of
resNotFound:
begin
ResErrDialog('Could not find a requested resource. ', theRoutine)
end;
resFNotFound:
begin
ResErrDialog('Could not find the resource file. ', theRoutine)
end;
addResFailed:
begin
ResErrDialog('Could not add a resource. ', theRoutine)
end;
rmvResFailed:
begin
ResErrDialog('Could not remove a resource. ', theRoutine)
end;
otherwise
begin
end;
end; { case myErr of }
end { if myErr <> noErr }
else
begin { if myErr = noErr }
WasResErr := false;
end;
end; { CheckResErr }
end.