Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Vfp50 - Do you know about ??CHR(27)+'*p0Y'
Message
From
15/07/1997 16:04:11
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00040071
Message ID:
00040092
Views:
49
>>thanks Vinod...the printers codes are for an HP III.
>>The function xy_offset is suppose to place a piece text onto
>>a form in the proper place and it does not work. The way I call the function
>>is called...
>>=xy_offset(100,200)
>>?? 'test'
>>Can you tell me why this does not work?
>>thanks..rob
>Rob,
>
>The code does not work because it written to directly address the printer and under windows you are removed from the printer by the print manager which takes all output and processes it through the printer driver that is selected. This wraps you PCL (HP Print Control Language) with printer control codes so that the printer sees it as data to be printed instead of controls codes. One way you can get it to work is to set the Generic Text printer dirver as the current printer under windows before you execute the code. The generic text driver will not add any printer contorl codes to you output but rahter just pass it on as it is (which is what you need).

thanks Jim for answering.. I can not use the Generic Text printer driver, I must
use the HP driver. Let me tell you what I am trying to do...
I am trying to open an .frm file and stuff it will DATA from a table
and print it out. Both the FRM and the DATA needs to print out at the
same time. Let me show you my code:

* for HP III/IV
m.brksz=1000
m.jfile=FOPEN('myformfile.frm')
m.sz = FSEEK(m.jfile,0,2)
=FSEEK(m.jfile,0)
m.ct=(m.sz/m.brksz)+1
FOR xxx = 1 TO m.ct
l_string=FREAD(m.jfile,m.brksz)
??? l_string
ENDFOR
=FCLOSE(m.jfile)

SET PRINTER ON
SET CONSOLE OFF
SET TALK OFF
?? CHR(27)+'(10U'+CHR(27)+'(s0p12.00h10.0v0s0b3T'
?? CHR(27)+'*p0X'
?? CHR(27)+'*p0Y'
=xy_offset(150,812)
?? 'test by rob'
?? CHR(27)+'E'
SET CONSOLE ON
SET PRINTER OFF


FUNCTION xy_offset
PARAMETER nx,ny
PRIVATE x,y
xoffset=0
yoffset=0
x=STR(nx+xoffset)
y=STR(ny+yoffset)
?? CHR(27)+'*p'+ALLTRIM(x)+'X'
?? CHR(27)+'*p'+ALLTRIM(y)+'Y'
RETURN
You are right, it works great in DOS, but I need to it work in vfp50 in win95.
any ideas?
Robert Keith
Independent Developer
San Antonio, Texas
E-mail address:
rebelrob1@yahoo.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform