* * GETFILES.KEX * * Issue a GET command against each file in the current file. The current * file can be a DIR.DIR file or an ordinary list of file names such as this: * * c:\common\test.dat * file.doc * e:\common\another.dat * \wp\test.let * * The argument you pass to this macro is the name of the file that will * hold the results of the GET operations. So, for example, you could issue * this command from the KEDIT command line: * * getfiles sum.txt * * and the new file, SUM.TXT, would be created and the contents of the above * named files would be loaded into it. If SUM.TXT already exists when this * macro is run, the original contents of this file are not included in the * results of the GET operation. * * Works with: * * KEDIT for Windows 1.5 * KEDIT 5.0 for DOS * KEDIT 5.0 for OS/2 * parse arg DestFile * Use some default file name if none is specified if DestFile = "" then DestFile = "data.dat" "preserve" "set autosave off" SourceFile = fileid.1() "kedit" DestFile "(noprof new" "kedit" SourceFile * Process each file in the list do i = 1 to size.1() ":"i "refresh" if dir() then FileName = dirfileid.1() else FileName = curline.3() "kedit" DestFile "*" "nomsg get" FileName if RC = 28 then do * RC = 28 means file not found 'emsg GETFILES Error 1: File not found "'FileName'"' exit 1 end if RC = 94 then do * RC = 94 means FSA is full "emsg GETFILES Error 2: Out of memory" exit 2 end "kedit" SourceFile end "top" "kedit" DestFile "restore" "top" exit 0