s_johansen%avh.unit.uninett@TOR.NTA.NO (Skule Johansen) (12/15/87)
Hello ! I want to use qualifiers in some command procedures. But there seems to be a loss of documentation about this topic. So I hope for information through the net. Can anyone send me some information about how to do qualifiers for command procedures (*.COM). I'm pleased if you also send an short example. Example for use : $ Delete/Confirm <file(s)> where '/confirm' are the qualifier. ________________________________________________________________________ MMMM.MMMMM | Mail : Skule Johansen M M | Stud. Post MMMMM.MMMMMMMMMM> | University at Lade M M M | N7000 TRONDHEIM MMM M | NORWAY M | EMail : S_Johansen@AVH.UNIT.UNINett (EAN) ------------------------------------------------------------------------
GG.UUU@ISUMVS.BITNET ("John Hascall") (12/17/87)
> From: Skule Johansen <s_johansen%avh.unit.uninett@TOR.nta.no> > Subject: Making Qualifiers. > > I want to use qualifiers in some command procedures. > But there seems to be a loss of documentation about > this topic. So I hope for information through the net. > > Can anyone send me some information about how to do > qualifiers for command procedures (*.COM). I'm pleased > if you also send an short example. > > Example for use : > > $ Delete/Confirm <file(s)> > > where '/confirm' are the qualifier. I'm assuming that you are using a foreign command for "Delete" to point it to the appropriate command procedure. The problem is DCL doesn't like constructs like: @delete.com /whatever (It complains about "/whatever" not being a valid qualifier for the "@" command.) The way we get around this is with something like: $ delete :== @disk:[dir]delete.com dummy Then you can do things like: $ delete /confirm because they expand to: $ @disk:[dir]delete.com dummy/comfirm which DCL does not complain about. Then you have to parse the parameter(s) (named p1, p2,... p8) in the command procedure. Probably the easiest method is to first concatenate them all together: $ options := "''p1' ''p2' ''p3' ''p4' ''p5' ''p6' ''p7' ''p8'" and then use the various lexical functions to extract the "dummy" and parse the qualifiers. Hope this is some help, John Hascall Iowa State University Computation Center GGUUU@ISUMVS.BITNET (p.s. My apologies if my use of quotes in the line "$ options :=..." is incorrect--I'm not on a VAX at the moment to try it out.)
HANNU@VAKK.UWASA.FI (Hannu Hirvonen) (12/18/87)
Perhaps the nicest feature of this type of communication is that it takes very little effort to make a fool of yourself before a truly global audience ... There was a stupid error in my previous reply: you get the whole command line in symbol P1 and P2...P8 remain undefined. The procedure I hastily consulted actually contains simple loop where the various command line arguments and qualifiers get assigned to P2 etc. Hannu Hirvonen System Manager with fingers faster than brain
HANNU@VAKK.UWASA.FI (Hannu Hirvonen) (12/18/87)
I'n not exactly sure what you mean by 'using qualifiers with command procedures' but if your intention is to define a symbol to invoke a command procedure and use qualifiers on this foreign command, here is what I have used on occasion: $ my_command :== @disk:[my_dir]my_procedure """ Now when I use 'my_command' the following way: $ my_command /qualifier1 /qualifier2 arg1 arg2 the symbols get these values: P1 = "/QUALIFIER1" P2 = "/QUALIFIER2" P3 = "ARG1" P4 = "ARG2" (Note that also the 'qualifiers' count towards the maximum of 8 command line arguments.) Hannu Hirvonen System Manager Computer Centre, University of Vaasa Vaasa, Finland