Google
 

Trailing-Edge - PDP-10 Archives - tops10_integ_tools_v4_10jan-86 - 70,6067/com20a/define.com
There are 3 other files named define.com in the archive. Click here to see a list.
$ save_verify := 'f$verify(command$debug)
$!
$! DEFINE.COM
$! Emulate the TOPS-20 define command
$! GMU	22-Aug-83 22:07	Version 2.05
$!
$! Command syntax:
$!
$!	$ DEFINE name equivalence	;Define "name" as "equivalence"
$!	$ DEFINE name			;Undefine "name"
$!	$ DEFINE *			;Undefine all logical names
$!
$! Since the VMS DEFINE command is so similar in format to the TOPS-20
$! DEFINE command, the main feature of this command file is that a
$! logical name can be undefined by specifying it with no equivalence
$! string.
$!
$!
$ on error then goto done
$ define := define				! Get around top level definition
START:
$ if p1 .eqs. "?" .or. -			! If user wants help
     p1 .eqs. "" then goto help_name		!  or no parameters, prompt him
$ if p2 .eqs. "" then goto undefine_logical	! No 2nd param => undefine
$ if p2 .eqs. "?" then goto help_definition	! See if help on definition
$!
$!
$! $ DEFINE (LOGICAL NAME) FOO (AS) BAR	- Define logical name FOO as BAR
$!
DEFINE_LOGICAL:
$ define 'p1' 'p2''p3''p4''p5''p6''p7''p8'	!Define the name
$ goto done
$!
$!
$! $ DEFINE (LOGICAL NAME) FOO	- Undefine logical name FOO
$!
UNDEFINE_LOGICAL:
$ if p1 .eqs. "*" then p1 := /ALL		!Allow DEFINE *
$ deassign 'p1'					! Deassign the name
$ goto done					! go finish up
$!
$!
$! Here to clean up
$!
$!
DONE:
$ save_verify := 'f$verify(save_verify)
$ exit
$!
$!
$! Here to help the user
$!
$!
HELP_NAME:
$ write sys$output "$ Define (logical name) ?"
$ write sys$output "  Logical name to define or delete,"
$ write sys$output "  or "*" to delete all"
$ inquire/nopunctuation p1 "$ Define (logical name) "
$!
$ p2 = ""					! Null out parameters
$ p3 = ""
$ p4 = ""
$ p5 = ""
$ p6 = ""
$ p7 = ""
$ p8 = ""
$!
$ if p1 .eqs. "" .or. -
     p1 .eqs. "?" then goto help_name		! Check for persistence
$ space := 'f$locate(" ",p1)'			! Find end of name
$ p1_length := 'f$length(p1)'			! Get length of parameter
$ if space .eq. p1_length then goto start	! If only one, continue
$ save_p1 := 'p1'				! Make a copy
$ p1 := 'f$extract(0,space,save_p1)'		! Extract just the first
$ space = space + 1				! Step past the space
$ p2 := 'f$extract(space,p1_length,save_p1)'	! get p2
$ goto start					! Try again
$!
$!
HELP_DEFINITION:
$ if p1 .eqs. "*" then goto help_delete		! Different if deleting
$ write sys$output "$ Define (logical name) ''p1' (as) ? Definition list or null to delete"
$ inquire/nopunctuation p2 "$ Define (logical name) ''p1' (as) "
$ p3 = ""
$ p4 = ""
$ p5 = ""
$ p6 = ""
$ p7 = ""
$ p8 = ""
$ goto start
$!
$!
HELP_DELETE:
$ write sys$output "$ Define (logical name) * ? Confirm to delete all logical names"
$ inquire/nopunctuation p2 "$ Define (logical name) * "
$ goto start