' ------------------------------------------------------------------------- ' GIS Laboratory ' Geological & Planetary Sciences Division ' Caltech ' ------------------------------------------------------------------------- ' Program : CMDLINE.AVE ' Purpose : Generate a command line interface ' ------------------------------------------------------------------------- ' Calls : none ' Called by: none ' ------------------------------------------------------------------------- ' Arguments: none ' Globals : none ' ------------------------------------------------------------------------- ' Notes : source - see page 144 of "Using Avenue" ' ------------------------------------------------------------------------- ' History : 10/21/97 - Tony Soeller; script created from text, above ' ------------------------------------------------------------------------- '. ' Prompt user to enter Avenue command command = MsgBox.input("Enter Avenue command:","Avenue","") if (command = nil) then exit end ' Create a script and look for compile errors cmdScript = Script.Make(command) if (cmdScript.HasError) then MsgBox.Error(cmdScript.GetErrorMsg+NL+command,"Compile Error") exit end ' Run the script and look for runtime error result = cmdScript.DoIt("") if (cmdScript.HasError) then MsgBox.Error(cmdScript.GetErrorMsg+NL+command,"Runtime Error") exit end ' Report the result if (result = nil) then report = "No return value" else report = "Result:"++result.AsString end MsgBox.Info(report, "Completed")