Joshua:
Try it with this one.
At least there is an output and I think it makes sense...
File_Open("c:\test\List.txt")
Begin_Of_File // to be safe (if file was already open)
#103=Buf_Num
File_Open("c:\test\Search.txt")
Begin_Of_File // to be safe (if file was already open)
#104=Buf_Num
File_Open("c:\test\Output.txt")
Begin_Of_File // to be safe (if file was already open)
#105=Buf_Num
Buf_Switch(#103) // switch to list.txt
While (! At_EOF) // While Not at EOF of list.txt
{
Reg_Copy_Block(103, Cur_Pos, EoL_Pos) // read curr. line (w/o CR/LF)
Buf_Switch(#104) // switch to Search.txt
Begin_Of_File
While (! At_EOF) // While not at EOF of Search.txt
{
Goto_Col(1) // column with text to find (only in testfile = 1)
if (Match("|@(103)") == 0 ) // if matching the text from List.txt
{
Line(1, NOERR+ERRBREAK) // goto next line
Search("|<X|A:\", NOERR) // search for the next filename
// (with leading X here in testfile)
// See online help for pattern matching codes!
if (!Error_Match) { // if found
Begin_Of_Line
Reg_Copy(104, 1) // get complete line
Buf_Switch(#105) // switch to output.txt
Reg_Ins(104) // insert line there
Buf_Switch(#104) // switch back to search.txt
}
}
Line(1, NOERR)
}
Buf_Switch(#103) // switch back to List.txt
Line(1, NOERR) // next line
}
Christian