NamesGVImportImpl.Mesa
Last modified by Swinehart, June 14, 1984 5:27:36 pm PDT
DIRECTORY
Commander USING [ CommandProc, Register ],
CommandToolExtras USING [ NumArgs, ArgN ],
NamesGVImpExp,
NamesGVRpcControl USING [ ImportInterface ],
IO,
Log USING [ Problem, Report ],
Names USING [ ROPE ],
RPC USING [ ImportFailed ],
UserProfile USING [ Token ]
;
NamesGVImportImpl:
CEDAR
PROGRAM
IMPORTS Commander, CommandToolExtras, IO, Log, RPC, NamesGVRpcControl, UserProfile
EXPORTS NamesGVImpExp = {
OPEN IO;
Data
ROPE: TYPE= Names.ROPE;
imported: BOOL←FALSE;
Import Procedure
GVImport:
PUBLIC
PROC [instance:
ROPE←
NIL]
RETURNS [success:
BOOL] = {
ENABLE
RPC.ImportFailed => { Log.Problem["Couldn't import NamesGV.Lark"]; CONTINUE; };
IF instance=
NIL
THEN
instance ← UserProfile.Token[key: "ThrushClientServerInstance", default: "Morley.Lark"];
IF ~imported
THEN NamesGVRpcControl.ImportInterface [[
type: "NamesGV.Lark",
instance: instance
]];
imported ← TRUE;
Log.Report[IO.PutFR["ImportInterface[NamesGV.Lark, %s]", rope[instance]], $System];
};
User command
CmdGVImport: Commander.CommandProc = {
[]←GVImport[IF CommandToolExtras.NumArgs[cmd]#0 THEN CommandToolExtras.ArgN[cmd,1] ELSE NIL];
};
Initialization
Commander.Register["GVImport", CmdGVImport, "Connect to remote NamesGV."];
}.