Reviewed August 2020
AGCMD {switches} <cmd> <parms>
AGCMD may be used to send a AG_xxx command from the dot prompt or within a command file without having to write code and compile it. It may be useful for experimentation and for inserting simple ATE or other GUI configuration commands in startup command files. Usage:
Parameters
cmd
the symbolic AG_xxx name (case insensitive, with or without the AG_ prefix), or numeric value of the AG command to execute.
parms
the parameter list as it would be passed in the AG_xxx statement, except without the trailing chr(127).
switches
Switch |
Function |
/K# |
Assign result to DO file variable $KBD# |
/S |
Silent (don't display the command response) |
/N |
No wait (don't wait for any response) |
/W:# |
Wait # seconds for response (overriding default) |
Examples
AGCMD WINEXEC,$DEL %ATE%\dsk0\001004\ftpdlx.log
AGCMD WINTITLE,This is the new and improved title
AGCMD SHOWWINDOW 3
AGCMD STATUSLINES,1,0
AGCMD/S 24,cmd.exe,option,"/c ipconfig > ipcfg.lst",,0,1
AGCMD/N PALETTE,3,0,123,207,242
AGCMD/S/K1 BROWSEFOLDER
.AGCMD GETENV %TEMP%
Response = C:\Users\joaqu\AppData\Local\Temp
Comments
If neither of the /N or /W:# switches are specified, AGCMD will use the "normal" wait value based on the command itself, ranging from no wait (for commands with no response, e.g. AG_STATUSLINES), to a few seconds (for commands with an immediate response, e.g. AG_GETENV), to unlimited (for commands which require a user response, e.g. AG_WINPTR).
Some commands have a variable response (or lack of), depending on the command parameters. For example, AG_PALETTE has no response when used to set a color, but has a "standard wait time" response when used to retrieve palette info. For these commands, AGCMD defaults to the "standard wait time" (a few seconds). To avoid waiting for a response that won't be coming, use the /N switch (as in the example above).
History
2017 July, A-Shell 6.5.1610: AGCMD.LIT 1.0(105) enhanced to support AG_SCROLLBACK:
.AGCMD AG_SCROLLBACK -1 ; toggle
.AGCMD AG_SCROLLBACK 1 ; show/enable
.AGCMD AG_SCROLLBACK 0 ; hide/disable
2011 May, A-Shell 5.1.1215: Added function to A-Shell