home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-11-03 | 719 b | 45 lines | [TEXT/CWIE] |
- unit MyMachineNames;
-
- interface
-
- uses
- Types;
-
- const
- owner_id = -16096;
- machine_id = -16413;
-
- function GetOwnerName: Str255;
- function GetMachineName: Str255;
-
- implementation
-
- uses
- TextUtils;
-
- function GetName (id1, id2: integer): Str255;
- var
- sh: StringHandle;
- begin
- sh := GetString(id1);
- if sh = nil then begin
- sh := GetString(id2);
- end;
- if sh <> nil then begin
- GetName := sh^^; { Don't release it, someone else may be using it }
- end else begin
- GetName := 'unnamed';
- end;
- end;
-
- function GetOwnerName: Str255;
- begin
- GetOwnerName := GetName(owner_id, machine_id);
- end;
-
- function GetMachineName: Str255;
- begin
- GetMachineName := GetName(machine_id, owner_id);
- end;
-
- end.