Reader's Clinic - CMD

Published ByDateVersionKnowledge LevelKeywords
Sprezzatura Ltd01 DEC 19923.0+EXPERTCMD, WINDOW_COMMON%

Dave Brown of Doorcraft Manufacturing writes "I was poking around in CMD and found the list of primitives it uses (REAL.ACCOUNTS and LIST.USERS are very helpful). There's too many commands to list here, and I've already figured out the use of some, but a few have me curious: STROKES, POST.APP.VIEWER, TMARK, SOURCE.IDS.CVT, GL, USER.NOVE, and DEST.DEFLT.". So for Dave (and others out there who might be curious), we present below the definitive guide to CMD - the system subroutine used by a large number of command windows. Note that to make use of this subroutine it is normally necessary to have Window_Common% loaded.

BranchWindows Used ByDescription
ATCH.OFATTACHTABLE
DETACHTABLE
VERIFYLH
Looks at @Record< 2 > and provides a popup of tables at that location for the current account. Multiple selections can be made and are returned in @Ans. If no location is specified in @Record<2> then the default location is used.
ATCH.PVATTACHTABLE
SETALIAS
Takes the location in WC_Is% and loads WC_REGISTER%(1) with a dynamic array of five fields with layout as follows:

< 1 > Location name
< 2 > Dos path to location
< 3 > Multi-valued list of tables at location
< 4 > Filing system used by location (E.G. RTP57)
< 5 > File handle for location, combine with < 4 > for file variable.
DEF.VOLUMELISTVOL
LISTVOLUME
MAKEDICT
MAKETABLE
SETALIAS
Returns the default data volume in @Ans.
DELETEREC.POSTDELETEROW
VERIFYLH
Adds "(" to the beginning of @Record<4> so that when @Record is executed as a TCL statement from a collector window (REVMEDIA passim) the options will be bracketed.
DEST.DEFLTIMPORT.TEMPLATEReturns the corresponding multi value from @Record<3>.
DTCH.SAVEDETACHTABLEUsed to abort a save if @Record<2> and <3> both contain information.
ESC.TO.NULLEDIT.ANOTHERUsed on a post window hook to set @Pseudo to null if escape was hit in the collector window.
FFE.REC.OPTFORMTakes WC_Register%(2) as the title and WC_Register%(3) as the table variable and displays a popup of rows in the table.
FFE.SAVEFORMMassages @Record to ensure that when it is executed as a TCL statement from the collector window it behaves properly.
FFE.SETUPUnusedLoads WC_Datafile% and @Record with REPORTS and opens WC_Src_File% to REPORTS.
FFE.WIN.POSTFORMUses the contents of WC_Is% to load the form into WC_Register%(1), the datafile into (2) and the file variable into (3).
FORMSPEC.SAVEMAKEFORM.PARMSSets @Record<1> to 1.
FREEFORM.SAVEUnusedSets @Record<1> to 1
GLGETLISTIf a select list is active produces a warning message that the select list will be overwritten by the current operation. The user is asked whether they wish to continue. If they do the select list is cleared.
LHV.VOLVERIFYLHChecks the locations contained in WC_Is% to be valid. If they are not an error message is displayed.
LIST.ACCOUNTSCOPYTABLE
RENAMETABLE
SETALIAS
Provides a popup of all applications on the system.
LIST.USERSUnusedProvides a popup of all users on the system.
MACRO.SAVEUnused?
MACROSMACROSLoads @Record with three fields containing 4 value marks space delimited.
MAKEDICT.PPSOURCE.WINDOW?
MAKEFORM.READUnusedLoads @Pseudo with @Fm concatenated to the window form parameters.
MAKEFORM.SAVEMAKEFORMCalls the form parameters window then returns the form definition in WC_Register%(1) and the form parameters in WC_Register%(10).
MAKELISTMAKELISTProvides a popup of all of the dictionary items for the table in WC_Datafile%.
MAKEVOCSETPROGRAMAdds "(" to the beginning of @Record<4> so that when @Record is executed as a TCL statement from a collector window (REVMEDIA passim) the options will be bracketed.
ML.FILTERUnusedProvides a popup of all of the records in the REPORTS table.
ML.FILTER.TEXTUnusedDoes not work.
ML.LINE.NUMBERUnusedDoes not work.
MOVECOPYTABLEPrompts the user for a table name to move to.
PFE.SETUPWFEClears down @Sentence.
POS3.OPTIONSLISTDICT
LISTVOLUME
Converts spaces and commas to value marks in @Record<3> and surrounds the whole in parentheses.
POS4.OPTIONSCOMPILEBASIC
LISTBASIC
Converts spaces and commas to value marks in @Record<4> and surrounds the whole in parentheses.
POST.APP.VIEWERUnusedUsed on a post window hook to set @Pseudo to null if escape was hit in the collector window.
PRESERVECUSTOMIZEUsed to provide the Preserve Keys/Fields popup in Customise.
PU.DISPLAYMAKEPOPUPUsed to display the current record as a popup in the MAKEPOPUP window.
REAL.ACCOUNTSMENU_SECURITY
OPENAPPLICATION
WINDOW.SECURITY
Provide a popup of all accounts on the system excluding GLOBAL.
REMAKEFILEREMAKETABLESets @Record<4> to @Account and @Record<5> to @Record<2>.
RL.ACCT.NOVEUnusedFor use as an edit pattern - rejects an entry that exists on SYSENV.
RL.ACCT.VERIOPENAPPLICATIONFor use as an edit pattern - rejects an entry that is not an application.
RUN.MENUMENURuns the menu named in @Record.
SETF.OFSETALIASLooks at @Record< 2 > and provides a popup of tables at that location for the account in @Record<3>. One selection can be made and is returned in @Ans. If no location is specified in @Record<2> then the default location is used.
SETVOLUMESETVOLUMEUsed to create a volume pointer in VOC from the current record.
SETVOLUME.DL.OPTIONSSETVOLUMEUsed for options on data location prompt.
SETVOLUME.VALID.VOLUMESETVOLUMEUsed to ensure that @Record<1> contains "VOLUME". If it does not, WC_Valid% is set to 0.
SFACCTSETALIASUsed as an edit pattern to ensure that an entry is an attachable location.
SFOSUMROWSDisplays popup of rows in table contained in @Record<2>.
SOURCE.IDS.CVTIMPORT.TEMPLATEDisplays popup of rows in table contained in @Record<1>. Allows multiple selections and puts result in @Record<3>.
STROKESUnusedAppears not to do anything.
TMARKUnusedConverts @Tms to spaces in @Record.
TRNBTREE
CREATE_TABLE
CROSSREV
DELETEROW
DETACHTABLE
FORMULA
NAMEVOLUME
PROCESS.WINDOW
SETPROGRAM
SMART.LABEL
SOFTKEYS
SOURCE.WINDOW
XLATE.ENTRY
Closes window if on a runtime version.
UNMAKEVOCUnusedCreates popup of all entries in VOC with F1 = "RBASIC" and permits multiple selections, with @Ans containing results.
USER.NOVEUnusedFor use as an edit pattern - rejects an entry that already exists on SYSENV.
USER.VERIUnusedFor use as an edit pattern - rejects an entry that is not a user in SYSENV.

(Volume 4, Issue 7, Pages 12-15)