Hi,
I am converting the following code from dbman to foxpro I thought i was
doing this right by using chr(27) for ESC but all it does is prints a box and
the codes and the printer does not use them :( The dbman program used a
command ESC() for this but is is not in foxpro.

old dbman code:

SET PRINT ON
****RESET
?? ESC("<27>E")
****MARGIN
?? ESC("<27>&a2L")
***LINE SPACING
?? ESC("<27>&l8D")
**SYMBOL SET ASCII
?? ESC("<27>(0U")
**SPACING FIXED
?? ESC("<27>(s0P")
**PITCH
?? ESC("<27>(s16.65H")
**Height
?? ESC("<27>(s14.25V")
**STYLE
?? ESC("<27>(s0S")
**Strke Weight
?? ESC("<27>(s0B")


new try at foxpro code:
SET PRINT ON
****RESET
?? CHR(27)+"E"
****MARGIN
?? CHR(27)+"&a2L"
***LINE SPACING
?? CHR(27)+ "&l8D"
**SYMBOL SET ASCII
?? CHR(27)+ "(0U"
**SPACING FIXED
?? CHR(27)+ "(s0P"
**PITCH
?? CHR(27)+ "(s16.65H"
**Height
?? CHR(27)+ "(s14.25V"
**STYLE
?? CHR(27)+ "(s0S"
**Strke Weight
?? CHR(27)+ "(s0B"

Re: printer esc codes by Jeroen

Jeroen
Sun Oct 17 05:03:37 CDT 2004

On Sat, 16 Oct 2004 09:53:05 -0700, "David"
<David@discussions.microsoft.com> wrote:

That should work.
(you could also try the ??? command, which doesn't move the internal
VFP row and column number)

Thses codes are very printer dependent (by the looks of it, for an HP
laserprinter), so check to make sure you use the right codes

How are you printing the 'real' info to the printer? Youw codes may be
overwritten later.

Same printers allow a hex dump of all the codes that are send to it,
so you can check if your program is actually sendingwhat you think it
should. (or redirect the fox printer to a file (doesn't work with ???
though))

>Hi,
> I am converting the following code from dbman to foxpro I thought i was
>doing this right by using chr(27) for ESC but all it does is prints a box and
>the codes and the printer does not use them :( The dbman program used a
>command ESC() for this but is is not in foxpro.
>
>old dbman code:
>
>SET PRINT ON
>****RESET
>?? ESC("<27>E")
>****MARGIN
>?? ESC("<27>&a2L")
>***LINE SPACING
>?? ESC("<27>&l8D")
>**SYMBOL SET ASCII
>?? ESC("<27>(0U")
>**SPACING FIXED
>?? ESC("<27>(s0P")
>**PITCH
>?? ESC("<27>(s16.65H")
>**Height
>?? ESC("<27>(s14.25V")
>**STYLE
>?? ESC("<27>(s0S")
>**Strke Weight
>?? ESC("<27>(s0B")
>
>
>new try at foxpro code:
>SET PRINT ON
>****RESET
>?? CHR(27)+"E"
>****MARGIN
>?? CHR(27)+"&a2L"
>***LINE SPACING
>?? CHR(27)+ "&l8D"
>**SYMBOL SET ASCII
>?? CHR(27)+ "(0U"
>**SPACING FIXED
>?? CHR(27)+ "(s0P"
>**PITCH
>?? CHR(27)+ "(s16.65H"
>**Height
>?? CHR(27)+ "(s14.25V"
>**STYLE
>?? CHR(27)+ "(s0S"
>**Strke Weight
>?? CHR(27)+ "(s0B"
>


RE: printer esc codes by Leemi

Leemi
Mon Oct 18 12:43:11 CDT 2004

Hi David:

Have you tied using @...SAY commands to send the printer codes?
http://support.microsoft.com/default.aspx?scid=KB;EN-US;99595

I hope this helps.

This posting is provided "AS IS" with no warranties, and confers no rights.

Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell

*-- VFP9 Public Beta Now Available!! --*
Download the VFP9 beta here: http://msdn.microsoft.com/vfoxpro/

*-- VFP8 HAS ARRIVED!! --*
Read about all the new features of VFP8 here:
http://www.universalthread.com/VisualFoxPro/News/VFP8Release.asp
Purchase VFP8 here:
http://shop.microsoft.com/Referral/Productinfo.asp?siteID=11518

Keep an eye on the product lifecycle for Visual FoxPro here:
http://support.microsoft.com/default.aspx?id=fh;[ln];lifeprodv
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retired Sept. 30th, 2003

>Hi,
> I am converting the following code from dbman to foxpro I thought i was
>doing this right by using chr(27) for ESC but all it does is prints a box
and
>the codes and the printer does not use them :( The dbman program used a
>command ESC() for this but is is not in foxpro.
>
>old dbman code:
>
>SET PRINT ON
>****RESET
>?? ESC("<27>E")
>****MARGIN
>?? ESC("<27>&a2L")
>***LINE SPACING
>?? ESC("<27>&l8D")
>**SYMBOL SET ASCII
>?? ESC("<27>(0U")
>**SPACING FIXED
>?? ESC("<27>(s0P")
>**PITCH
>?? ESC("<27>(s16.65H")
>**Height
>?? ESC("<27>(s14.25V")
>**STYLE
>?? ESC("<27>(s0S")
>**Strke Weight
>?? ESC("<27>(s0B")
>
>
>new try at foxpro code:
>SET PRINT ON
>****RESET
>?? CHR(27)+"E"
>****MARGIN
>?? CHR(27)+"&a2L"
>***LINE SPACING
>?? CHR(27)+ "&l8D"
>**SYMBOL SET ASCII
>?? CHR(27)+ "(0U"
>**SPACING FIXED
>?? CHR(27)+ "(s0P"
>**PITCH
>?? CHR(27)+ "(s16.65H"
>**Height
>?? CHR(27)+ "(s14.25V"
>**STYLE
>?? CHR(27)+ "(s0S"
>**Strke Weight
>?? CHR(27)+ "(s0B"
>


Re: printer esc codes by Neil

Neil
Mon Oct 18 15:26:26 CDT 2004

Try using SET DEVICE, e.g.

SET DEVICE TO PRINTER
SET CONSOLE OFF

<your code here>

SET CONSOLE ON
SET DEVICE TO SCREEN

"David" <David@discussions.microsoft.com> wrote in message
news:A583EBF9-97B3-4921-9732-276027416BE1@microsoft.com...
> Hi,
> I am converting the following code from dbman to foxpro I thought i was
> doing this right by using chr(27) for ESC but all it does is prints a box
and
> the codes and the printer does not use them :( The dbman program used a
> command ESC() for this but is is not in foxpro.
>
> old dbman code:
>
> SET PRINT ON
> ****RESET
> ?? ESC("<27>E")
> ****MARGIN
> ?? ESC("<27>&a2L")
> ***LINE SPACING
> ?? ESC("<27>&l8D")
> **SYMBOL SET ASCII
> ?? ESC("<27>(0U")
> **SPACING FIXED
> ?? ESC("<27>(s0P")
> **PITCH
> ?? ESC("<27>(s16.65H")
> **Height
> ?? ESC("<27>(s14.25V")
> **STYLE
> ?? ESC("<27>(s0S")
> **Strke Weight
> ?? ESC("<27>(s0B")
>
>
> new try at foxpro code:
> SET PRINT ON
> ****RESET
> ?? CHR(27)+"E"
> ****MARGIN
> ?? CHR(27)+"&a2L"
> ***LINE SPACING
> ?? CHR(27)+ "&l8D"
> **SYMBOL SET ASCII
> ?? CHR(27)+ "(0U"
> **SPACING FIXED
> ?? CHR(27)+ "(s0P"
> **PITCH
> ?? CHR(27)+ "(s16.65H"
> **Height
> ?? CHR(27)+ "(s14.25V"
> **STYLE
> ?? CHR(27)+ "(s0S"
> **Strke Weight
> ?? CHR(27)+ "(s0B"
>
>