! Page 3 procedure eveplus_key ! Redefine a key, saving old definition ( new_pgm, ! Valid 1st argument for define_key builtin default_key, ! Default keyname if user hasn't defined one new_doc, ! Valid 3rd argument for define_key builtin key_string ) ! String containing name for user defined keys ! 1) Determine if we have a user specified key; if not, use default. ! 2) Save the present definition & doc. of the user specified key. ! 3) Do a define key on the new key information. ! A note on methods: ! We use a string argument for the variable name of the user specified key ! so that: 1) We can successfully pass it to this procedure if its not defined. ! 2) We can generate variables to hold the old key's info, avoiding ! passing more arguments for these. ! We combine the string argument with string constants to form valid TPU ! statements which we then execute. (Ha! We TPU programmers can limp ! along without LISP very well thanks!) on_error endon_error; eveplus$x := default_key; ! default, to global variables; the variables eveplus$x_string := key_string; ! Move arguments, which are local by eveplus$x_old_pgm := 0; ! in and EXECUTE statement are all global. ! Determine if we have a user specified key; if not, use default. if expand_name ( eveplus$x_string, variables ) <> eve$x_null then execute ( 'if(get_info('+eveplus$x_string+',"type")=integer)then ' +'eveplus$x:='+eveplus$x_string+';' +'else ' +eveplus$x_string+':=eveplus$x;' +'endif;' ); else execute ( eveplus$x_string+ ':= eveplus$x;' ); endif; ! Save the present definition & doc. of the user specified key ! one exists. eveplus$x_old_pgm := lookup_key ( eveplus$x, program); if (get_info ( eveplus$x_old_pgm, "type") = program) then execute( eveplus$x_string +'_doc := lookup_key ( eveplus$x, comment);' +eveplus$x_string +'_pgm := lookup_key ( eveplus$x, program);'); else execute( eveplus$x_string +'_doc := "~none~";'); endif; ! Do a define key on the new key information define_key ( new_pgm, eveplus$x, new_doc,"eve$standard_keys" ); endprocedure