new problem with FORM...(helllllp!!!) :)

Fairlight fairlite at fairlite.com
Tue Jul 10 12:27:49 PDT 2007


On Tue, Jul 10, 2007 at 01:46:47PM -0400, after drawing runes in goat's blood,
Brian K. White cast forth these immortal, mystical words:
> Step through in debug mode and watch that the form/formm command is actually 
[snip]
> 
> Then: msgbox "formm \""{FormName{"\"" ; formm ""{FormName{"" ; msgbox "done"

The former was needed, definitely.  The latter I'd already done at the time
of my last prior post back to Bruce via the list and discovered that it was
never getting executed more than the number of pages generated, meaning
that it wasn't just a page going away, it was a page not getting generated.

George came closest, as I said, with implying an extra "print" before the
exit.  Dunno if it was luck or good thinking, but here's what was going on:

The original was being run in clerk on an actual screen.  If you hit the
key (F), it would let you run that form, and *poof* it worked.  But mind
that you're already in fP and sitting on a record (hence the original nm=1
to get the name...getting it from the record on which you're sitting).

The modified copy was meant to be run in a CGI environment.  I -need- EXIT
to actually quit out and close things out so I can move on to Print Wizard,
generate the PDF, send the file back, and close down that run.

The problem became apparent when running through the whole thing in debug
mode.  There was a test at the end of report -content- generation that said
"If: nm=aaa(1) Then: goto more1".  The problem is that the FORM command is
the first line in the more1 subroutine, and since you've already gone
through numerous GETNEXT statements before looping around (a small flaw in
the original logic, but harmless), the names don't match, and it should
drop through and to to the end subroutine (which can also be called
independently with goto).  Well since FORM is in more1, and we're not
looping back up to more1 because the names no longer match, guess what
never occurred?  The FORM call, of course.

The issue in my mind then became, "Why does it work -at all- in the
original version?  Why do you get all your pages -there- with the same
exact code?"

Because it's not -quite- the same exact code.  I replaced 'end' with 'exit'
in precisely one place.  The problem is that END apparently actually
flushes the form, EXIT does not.  I made it:

     form "billcgi";exit

All is well.

It all stemmed from the developer's prior reliance on END to flush the last
page of the form, combined with my not being aware that it did so while
using the EXIT that I needed under the circumstances.  In effect, it wasn't
the 5 lines of code I added, it was the -one word- I had to -change- to run
it in a CGI environment from the command line to get it to totally exit.
Aside from exiting the program, I'd have expected EXIT to act as an END in
all other respects.  Apparently not.

DOH!  :)

Thanks for everyone's considered input!

mark->


More information about the Filepro-list mailing list