/* defining key value - a shifted key can use "-" or "_" in its name */
'DEFINE F3 OSNOWAIT EXIT'
/* you can even do complex things: */
'DEFINE ( MC /TEXT ()/cleft'
'DEFINE F8 OSNOWAIT RX line = insert(date(),line,currOfs); currOfs = currOfs+length(date())'
'DEFINE S-F7 osn rx if currTab = 0 then currTab = findcontextcompletion(); if currTab \= 0 then do; say; do i = 1 to tree.0; say tree.i; end; call charout, print(); oline=""; parse value SysCurPos() with origRow origCol .; key="tab"; end'
/* we can even add a new feature: loading/saving commands history */
/* first, we define a file name (and make it public, F7 requires it): */
history = expand('%tmp%\history.shl'); global = global 'history'
/* then, an alias, LOADHIST, which loads the commands history */
'ALIAS LOADHIST=RX drop prevLine.; i = 0; do while lines(history); i = i+1; prevLine.i = linein(history); end; prevLine.0 = i; call stream history, "c", "close"'
/* now, we define three function keys, F2 (save), F5 (load/refresh) */
/* and F7 (name) */
'DEFINE F2 OSNOWAIT RX "@del /f" history; do i = 1 to prevLine.0; call lineout history, prevLine.i; end; call stream history, "c", "close"'