// // FILEMERGE.VDM Christian Ziemski 27.10.2000 // 09.10.2003 // // Merge a bunch of files inclusive the filenames in a resulting file. // // create a sorted list of files // here you have to qualify the path and filenames // of your files to be consolidated: Chdir("C:\xxx") Sys("dir *.txt /o:d /b > consfile.out", DOS+SIMPLE) #103=Buf_Num // remember the current buffer (with whatever contents) Buf_Switch(#104=Buf_Free) // a new free buffer File_Save_As("consfile.res",OK+NOMSG) // will hold the results later Buf_Switch(#105=Buf_Free) // another free buffer File_Open("consfile.out") // to build the commands from the file list BoF while (! At_EoF){ Reg_Copy_Block(99,Cur_Pos,EoL_Pos) Ins_Text('Ins_Text("*** ') EoL Ins_Text(' ***") ') Ins_Text('Ins_Newline(1) ') Ins_Text('Ins_File("') Reg_Ins(99) Ins_Text('") ') Ins_Text('Ins_Newline(1) ') Line(1) } Buf_Switch(#104) // jump to buffer for results Call(#105+buffer) // call the above created macro Buf_Switch(#105) // delete the buffer with macro Buf_Quit(OK) Buf_Switch(#104) File_Save(NOMSG) // save the result // Buf_Quit(OK) // if you wish: close results // Buf_Switch(#103) // and switch back to original buffer