I've written this little proggie thats suppose to compair the contents of 2 files - source & master - and write out any changes into a third file - combi.
But its failing around the LEN commands, any kind person give me a push in the right direction please.
(As ya can see for yourself, if the master file is different to the source then it takes priority)
But its failing around the LEN commands, any kind person give me a push in the right direction please.
(As ya can see for yourself, if the master file is different to the source then it takes priority)
Local master_buffer:String Local source_buffer:String Local masterbufflen:Int Local sourcebufflen:Int master=ReadStream("c:\\master.txt") If Not master RuntimeError "Failed to open MASTER file" source=ReadStream("c:\\source.txt") If Not source RuntimeError "Failed to open SOURCE file" combi=CreateFile("c:\\combi.txt") If Not combi RuntimeError "Error creating file" combi=OpenStream("c:\\combi.txt") While Not Eof(master) master_buffer=ReadLine(master) source_buffer=ReadLine(source) sourcebufflen=Len(source_buffer) masterbufflen=Len(master_buffer) Print sourcebufflen Print masterbufflen If sourcebufflen<masterbufflen Then Print master_buffer WriteLine(combi,master_buffer) EndIf If sourcebufflen>masterbufflen Then Print source_buffer WriteLine(combi,source_buffer) EndIf Wend CloseStream master CloseStream source CloseStream combi