|
Home > Archive > FoxPro Help and Support > October 2005 > Can't get ? or ?? commands to get to SET ALTERNATE TO file.
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Can't get ? or ?? commands to get to SET ALTERNATE TO file.
|
|
|
| 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
| |
| Mark McCasland 2005-09-30, 3:24 am |
| 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.
"Jud" <judsonrp@fastmail.fm> wrote in message
news:1128023848.971866.83020@f14g2000cwb.googlegroups.com...
> 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
>
| |
| Pete Fisher 2005-10-02, 8:24 pm |
| In message <1128023848.971866.83020@f14g2000cwb.googlegroups.com>, Jud
<judsonrp@fastmail.fm> writes
>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
Never tried it from the command window but I have often used 'SET
ALTERNATE' for sending output to a text file form within a program.
Seems to me perhaps you need to change the order to?:
SET ALTERNATE TO BUGSCRN
SET ALTERNATE ON
DO XFRLINES
SET ALTERNATE OFF
SET ALTERNATE TO
MODI FILE BUGSCRN.TXT
--
+-----------------------------------------------------------------+
| Pete Fisher at Home: Peter@ps-fisher.demon.co.uk |
| http://www.flarefox.com/Lesbordes |
+-----------------------------------------------------------------+
| |
|
| 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
|
|
|
|
|