Can't get ? or ?? commands to get to SET ALTERNATE TO file.

Can't get ? or ?? commands to get to SET ALTERNATE TO file.

Post by Jud » Sat, 01 Oct 2005 04:57:29


Hello all,
I work in VFP6. In order to debug a .prg I added some print command
lines to it as follows:

? "OK - " + ALLTRIM(STR(RECNO("LINES"))) + " "

and

?? CHR(7) + "#"

which does just what I want on the screen. But, the first lines scroll
up off of the screen and are lost.
So, I entered into the Command Window the following:

SET ALTERNATE ON
SET ALTERNATE TO BUGSCRN
DO XFRLINES
SET ALTERNATE TO
SET ALTERNATE OFF
MODI FILE BUGSCRN.TXT

Unfortunately, the only thing I find in BUGSCRN.TXT is a single period
in the first column on the first line. I remember using "SET
ALTERNATE" years ago in FP 1.02 DOS and the period at the end of the
file. But, where are the more than 300 characters XFRLINES.PRG prints
on the screen that should also be in BUGSCRN.TXT!

Can someone explain why this doesn't work.

Thanks for any help (I spent over an hour in the Help file).

Jud
 
 
 

Can't get ? or ?? commands to get to SET ALTERNATE TO file.

Post by Mark McCas » Sat, 01 Oct 2005 11:17:17

I think the following works in VFP6, though I am not sure since I no longer
have that version installed --

SET DEBUGOUT TO MyDebugOutputFile.txt ADDITIVE

Whenever you want to write a line to that file, just issue the following
command:

DEBUGOUT "your message here"

When finished:

SET DEBUGOUT TO

Once you turn on the DEBUGOUTput to a file, you can just leave it "on", and
issue DEBUGOUT commands as many times as you want before you issue the SET
DEBUGOUT TO command to turn it off. The beauty of this is you do not have to
remember to remove these lines of code because they do not affect your app
during runtime.

 
 
 

Can't get ? or ?? commands to get to SET ALTERNATE TO file.

Post by Jud » Sun, 09 Oct 2005 03:05:54

Hi Mark and Pete,

Thank you both for your help.
I hadn't discovered DEBUGOUT yet, but it's in my toolkit now.
And I had scoured Help about SET ALTERNATE and did exactly as it said
rather than reversing the order of the commands. Which worked
perfectly!

Again thanks,
Jud