[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

XPL advice required



As I work through successive drafts of a document, I'm trying to work out a
simple XPL routine to insert the word count at the top of each new file.
The kludgy routine I've devised so far does the following:
  (1) save word count as a value
  (2) insert "[space]words[space]" at top of file
  (3) go back to " words " and insert the saved word-count value
The final step is to import (at the top of the file) a separate boilerplate
file (C:\emq\header.prf) consisting of page size, font & size, and running
header.

Here's the XPL as it stands -- ≪...≫ = guillemets, {..} = function calls:

≪SV901, words ≫≪SX01,≪VA$WC≫≫{ES}{TF}{SI}≪GT901≫{BC}seba |
words|{XC}≪GT01≫{TF}{BC}me \emq\header.prf{XC}≪EX≫

My problem is that this seems to work *sometimes*, but at other times it
produces a crazy word count -- sometimes 11 or 15, sometimes 1 (the files
are on the order of 600-800 words). And even when it does work, it always
inserts a smiley-face (ASCII 1) right after the word-count figure.

Can the collective wisdom advise?

Cheers
Eric Van Tassel