Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
@... say can't print
Message
From
02/07/2002 16:06:17
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00674407
Message ID:
00674698
Views:
17
In addition to what Sergey told you, in VFP it is 'SET PRINTER TO NAME getprinter()'

I have some code that actually runs in both environments, I test for the environment like this:
#IF 'VISUAL' $ UPPER(VERSION())    && VFP6/7
    *the variable port is filled with a value from a table
    *each report has a record in a table where the user can
    *choose which printer to send that report to.  The port
    *field is populated with getprinter() in a printer setup form
    PRIVATE gnPos
    PRIVATE ARRAY gaPrinters(1,2)
    =APRINTERS(gaprinters)
    gnPos = ASCAN(gaPrinters,port) && Search for printer name
    IF LEN(ALLTRIM(port))=0 OR gnPos=0	&& not found
	*--If no printer is setup,then use the default windows printer
	port = SET('PRINTER TO',2)
    ENDIF
    port=LTRIM(port)
    SET PRINTER TO NAME (port)
#ELSE                               && FPD26
    SET PRINTER TO junk
    EJECT
    SET PRINT TO &port
#ENDIF
SET DEVICE TO PRINT
When finished printing, we call a program called prntreset:
#IF 'VISUAL' $ UPPER(VERSION()) && VFP6/7
	SET CONSOLE ON
	SET DEVICE TO SCREEN
	SET PRINT TO
	ACTIVATE SCREEN
#ELSE                           && FPD26
	SET DEVICE TO SCREEN
	SET PRINT TO
	IF !EMPTY(postdos)  && specific reset codes for some printers
    	 RUN /64 &postdos
	ENDIF
#ENDIF

RETURN
>Hi guys...
>
>Got some problem here...
>I installed Visual Foxpro and FoxPro 2.X..
>In foxpro 2.X statement like :
>
> set device to printer
> set printer to getprinter()
> set printer on
> @10,10 say "Universal Thread"
>
>Will print "Universal Thread" in a printer...
>But why it didn't print at all in visual foxpro...
>Do i miss something
>
>Please help me out here...
>
>If Any of you have some others solution..
>
>thanks
>
>regards,
>tut_arie
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Reply
Map
View

Click here to load this message in the networking platform