(1 / 1)
Date: February 22, 1985 18:52
From: KIM::SUTTLES
To: @SYS$MAIL:JUNK,SUTTLES
Hiya, VAX fans! At one time there was a cartoon posted in 1501 that read something like: "First you set default SYS$USERDISK:, then you type @SYS$SYSDEVICE:[UTILITIES.COM]NOLOG, then..." Well, we SYS$MANAGER types resemble that remark. So, we have an announcement: You can now use UTL$MAC: instead of SYS$SYSDEVICE:[UTILITIES]. You can now use UTL$COM: instead of SYS$SYSDEVICE:[UTILITIES.COM]. You can now use UTL$EXE: instead of SYS$SYSDEVICE:[UTILITIES.EXE]. These are on all 4 systems. You may edit your com files to make them shorter, or easier to read, or you may leave them alone, at your option. We will use the new names in future announcements of new utilities (even used ones) cuz they are easier for us to type, as well. ...and now.... I dunno if any of you have felt as limited as I have by DCL's constant refusal to believe in subroutines, but for those of you who have, there is: HLLDCL!!! (sorry, Greg) You can now include in your command files, the line: $ @UTL$COM:HLLDCL ! (told ya!) and you will have the symbols JSB, SUBR, and RSB defined. I picked these names so they wouldn't conflict with the GOSUB and RETURN command files of olden days. You can also pick your own names, by specifying them in that order. You MAY NOT NEST routines called this way. If you want to, you have to execute HLLDCL a second time, and provide a whole new vocabulary to it, as in: $ @UTL$COM:HLLDCL CALL ROUTINE RET To use these new words, you MUST enclose them in tic marks: $! Assuming: $! Assuming: $! $ @HLLDCL $! $ @HLLDCL CALL ROUTINE RET $! then this is legal: $! then this is legal: $! $ 'jsr' routine_name $! $ 'call' my_routine $! $ . $! $ . $! $ . $! $ . $! $ . $! $ . $! $ exit $! $ exit $! $ $! $ $! $routine_name: 'subr' $! $my_routine: 'routine' $! $ . $! $ . $! $ . $! $ . $! $ . $! $ . $! $ 'rsb' $! $ 'ret' Notice that the two examples use different vocabularies: the first allows the default vocabulary (identical to @HLLDCL JSR SUBR RSB) and the second calls out different verbs to be defined. Notice the tic marks! Because of the different vocabularies, ROUTINE_NAME may 'CALL' MY_ROUTINEMY_ROUTINE may 'JSR' ROUTINE_NAME, but not both (circular recursion). You can multiply this technique to any practical limit. Pairs must match (in the examples, you must 'RSB' from a 'JSB' and 'RET' from a 'CALL'). The definition of the routine must also be from the same set (you must 'JSB' to a 'SUBR', not to a 'ROUTINE'). Oh, yeah, the command file generates a label that is a 16-digit decimal number that is supposed to be unique each time you execute it (it is built from the current time of day in hundredths of seconds). So, don't use any 16-digit numeric-only labels in the command procedures you wanna use HLLDCL within. (Is that a reasonable restriction??) The whole thing hinges on how DCL handles labels in command procedures, and relies pretty heavily on symbol substitution (by the way, the symbols so defined are defined as globals...they will live past the exit of your command file, so don't use words like DIR or SET {you won't do it twice, anyways}). The inner workings are kinda hard to explain, so I won't. Rest easy, though, the things it relies on are documented and therefore supported, so we can complain to DEC if it breaks. Also, the whole thing is tested pretty thoroughly, cuz I couldn't believe there really was a way to do what I wanted, that has been under my nose for all this time. Have fun, and let me know if you have any problems (so I can avoid them). sas
Feb 22, 1985