How to Delete Formfeeds in a File
Keywords: formfeed ascii 12
Question:
I am appending two files together with the FileAppend function. Unfortunately,
when I print the file, the first file prints and then ejects the page before
the second file prints. I want them on the same page. Suggestions?
Answer:
Here's some **untested** code to search for the formfeed (ASCII 12) in your
fileappend file, and delete the first one it comes across.
file="c:\temp\thefile.txt" ;this is your appended file
binbuf=BinaryAlloc(file+10)
size=BinaryEodGet(binbuf)
For i=0 to size-1 ;this will go character-by-character until finds formfeed
a=BinaryPeek( binbuf, i )
if a==12 ;if character is a formfeed
BinaryPoke( binbuf, i, 32) ;this pokes a space (ascii 32)
exit
endif
next
Article ID: W13702
Filename: Remove Formfeed in Appended Files.txt