>I'm seeing
>
>Voucher Header
>Voucher Detail Line 1
>Voucher Detail Line 2
>
>Voucher Detail Line 1
>Voucher Detail Line 2
>
>Voucher Detail Line 1
>Voucher Detail Line 2
>
>Voucher Header
>etc.
>
>
>Sorry for the length of this, but I've never seen behaviour like this from fputs. Wassup?
1) make sure the last field in line2 doesn't contain a linefeed or a carriage return.
2) try to use just a carriage return: instead of fputs(h, string), try fwrite(h, string+chr(13))
3) in the debugger, keep a watch on asc(right(string,1)). If it shows 13 or 10, it proves (1).
4) are you sure you aren't watching the text file in an editor which wraps? Try it in modify command (so it wouldn't wrap). Maybe the file is OK... try to look at it using home()+"tools\hexedit\hexedit.app".