From: CSBVAX::CSBVAX::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 3-MAR-1989 00:56 To: MRGATE::"ARISIA::EVERHART" Subj: Re: DCL hacks Received: From KL.SRI.COM by CRVAX.SRI.COM with TCP; Mon, 27 FEB 89 11:08:05 PDT Received: from ucbvax.Berkeley.EDU by KL.SRI.COM with TCP; Mon, 27 Feb 89 10:41:02 PST Received: by ucbvax.Berkeley.EDU (5.61/1.34) id AA12829; Mon, 27 Feb 89 10:19:19 -0800 Received: from USENET by ucbvax.Berkeley.EDU with netnews for info-vax@kl.sri.com (info-vax@kl.sri.com) (contact usenet@ucbvax.Berkeley.EDU if you have questions) Date: 27 Feb 89 17:46:54 GMT From: unmvax!nmtsun!warner%hydrovax.nmt.edu@ucbvax.Berkeley.EDU (M. Warner Losh) Organization: New Mexico Tech Hydrology Program Subject: Re: DCL hacks Message-Id: <2035@nmtsun.nmt.edu> Sender: info-vax-request@kl.sri.com To: info-vax@kl.sri.com In article <890225063810.21800215@NMFECC.ARPA>, CHCSRHS%LJV8.SAINET.MFENET@NMFECC.ARPA writes... >I think that an informative and interesting subject to start on info-vax >would be all of the DCL hacks that people know. One was mentioned a while >back that could start off the list in that DCL treats all devices like they >are files. This causes interesting things to happen when you use the command: >$ @device_name: >Anybody got any others? Any u-fische readers out there that can share some >of the fishy stuff DCL does? There are all kinds of DCL tricks that you pick up over the years. Here are some of my favorites: 1) !'F$VERIFY(0) When you have this line as the first line of your file, then you DCL will turn ECHO off without displaying any lines at all. This was undocumented for a long time, but the 5.0 release notes says that it will work. Nothing else with tick substitution will work inside a comment, at least the best of my knowledge. While you may be saying "Big deal, why should the fact that it is a comment mean anything." It will also work outside a comment. DCL's operates more or less in the following mannor when it comes to command line echoing when verify is turned on: i) Evaluate all 'xx stuff ii) if verify is set, then echo line iii) do the line so if you can turn verify off in the first phase, the second phase won't echo it. Commands like SET VERIFY or x=F$VERIFY(0) set verify in the third phase. But commands like x='F$VERIFY (0) or !'F$VERIFY(0) will turn verify off in phase one. 2) GOTO 'Symbol You can use this trick to simulate a case statement. There are some problems with it, however. If your symbol expands to a label that is not present in your program, then you get a warning about there not being that label. VMSINSTAL.COM uses this trick to dispatch all of its call back commands. 3) COPY XX out.junk If you open XX from DCL ($ OPEN XX FOO.BAR) and then read five or six lines from FOO.BAR, then issue the COPY command, the rest of the file gets copied. I use this trick in my UNSHAR.COM that I just posted. I tired using @XX, but for some reason that didn't work aout too well. 4) Arrays in DCL I bet you didn't think you could have arrays in DCL. VMS_SHAR and VMS_SHARE use them. Basically you have a whole bunch of symbols like ARRAY_1, ARRAY_2, ARRAY_3, etc. The name isn't important. Now, to get at the Ith element of the array, you say ARRAY_'I and use symbol substitution to get the job done. If I were 4, then in the first pass ARRAY_'I gets translated to ARRAY_4, then ARRAY_4 is used in whatever context it appeared as if you had typed that originally. The best way to see the DCL tricks that can be done is to look at VMS_SHAR, SYS$UPDATE:VMSINSTAL.COM (You may have to reformat this one, it has been "compiled" (all the unnecessary white space removed)), SYS$UPDATE:SPKITBLD.COM and many that have been posted to the net whose names escape me at the moment. >Robin Sanner -- Warner Losh warner@hydrovax.nmt.edu ...!unmvax!nmtsun!warner%hydrovax What happened to our innocence, did it go out of style? My spelling and views are my own. Only the letters have been changed...