WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Printing Information

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

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
File Created: 1999:04:15:16:55:48
Last Updated: 1999:04:15:16:55:48