home *** CD-ROM | disk | FTP | other *** search
- /*
- ** $VER: LearnToKey.edge 1.0 (Thursday 30-Sep-93 19:49:49)
- **
- ** Record and bind to a key a macro named as the key.
- **
- ** Written by Thomas liljetoft
- */
-
-
- options results
-
- /* get users error report level */
- 'getenvvar' _ge_errlevel
- errlevel = result
-
- 'requestkey' /* get key sequence */
-
- if RC = 0 then
- do
- parse var result 'KEY="' key '" Q="' qual '" QM="' qualmask '"'
-
- /* remove all spaces and create a filename */
-
- filename = key"_"compress(qual)"_"compress(qualmask)
-
- /* add the key with the filename as the command, in ram: */
-
- keyboard '"'key'"' Q '"'qual'"' QM '"'qualmask'"' '"ram:'filename'"'
-
- if RC = 0 then
- do
-
- /* if the key was succesfully added, start learning */
- learn '"ram:'filename'"'
-
- end
-
- end
-
- if RC >= errlevel then
- do
- fault
- requestnotify result
- end
-