* * Name: RECORDIT KEX * Author: Mark J. Short (mrkshrt@transparentsolutions.com) * Company: Transparent Solutions, Inc. (http://www.transparentsolutions.com) * Original Xedit: December 6, 1989 * Converted to Kex: September 4, 1998 * * Description: * This Kex macro is used to record the cmdline into a file. * What this gives you is the ability to write an Kex macro as * you test it. It is invoked by typing "RECORDIT filename" on the * command line. This will cause every line command to be recorded * in a filed named "filename.krex" until "end" is typed on the * command line. The file will have all the commands surrounded by * quotes, and the comment line on line one. * NOTE: I named the file extension rkex instead of kex to avoid accidents. * From here you can add in loops, conditionals, etc... * parse arg fn . * make sure that I have a filename if fn = '' then do Dialog '/Enter a filename (no extension)/ EDITfield /'fname.1() if dialog.1 = "" | dialog.2 = 'CANCEL' then return else fn = dialog.1 end fn = "c:\program files\keditw\"strip(fn)".rkex" call lineout fn,'* Recorded macro - ' fn '-' Date() Time() stoppers = 'RECORDIT END QQ QQUIT FILE' readv.1 = '' * read and execute commands typed on command line until a stop type command is issued Do while wordpos(translate(strip(readv.1)),stoppers) = 0 Msg '***' dialog.1 'is being recorded, type "END" to stop. ***' "READV CMDLINE" if wordpos(translate(strip(readv.1)),stoppers) = 0 & readv.1 <> '' then do readv.1 if readv.1 <> "?" then call lineout fn,'"'readv.1'"' end end 'MSG Keystrokes recorded and stored in' fn call lineout fn /* close the file */ * * Copyright 1998 Mark J. Short, Transparent Solutions, Inc.