I'm converting a Clipper app to VFP. The printing is acting oddly.
For example, the following PRG prints fine as a stand-alone, yet does not print at all when I include it in the application - all I get is a blank piece of paper ejected. The programs calling this are plain vanilla menus.
I'm baffled. Also, sometimes a report will spool to the printer, but not print until I leave VFP.
Ideas?
===
This prints fine as a standalone but not in the application.
SET DEVICE TO SCREEN
SET PRINT OFF
CLOSE ALL
USE codemstr INDEX cdkey
STORE 0 TO mcount
STORE 1 TO mpage
STORE 65 TO MLINE
STORE msysname TO header1
STORE "Comment Code Master File List" TO header2
SET PRINT ON
SET DEVICE TO PRINT PROMPT
DO WHILE .NOT. EOF()
IF MLINE > 56
@ 1, 0 SAY "Time " + TIME()
@ 1,(80 - LEN (TRIM(mpcname))) / 2 SAY mpcname
@ 1, 65 SAY "Page " + STR(mpage,3)
@ 2, 0 SAY "Date "
@ 2, 5 SAY DATE()
@ 2,(80 - LEN (TRIM(header1))) / 2 SAY header1
@ 3,(80 - LEN (TRIM(header2))) / 2 SAY header2
@ 5, 0 SAY "Code Comment"
STORE mpage + 1 TO mpage
STORE 6 TO MLINE
ENDIF
@ MLINE, 0 SAY cdcode
@ MLINE, 7 SAY cddesc
STORE MLINE + 1 TO MLINE
STORE mcount + 1 TO mcount
SKIP
ENDDO
STORE MLINE + 1 TO MLINE
@ MLINE, 0 SAY "Total "
@ MLINE, 7 SAY mcount PICTURE "999"
EJECT
SET DEVICE TO SCREEN
SET PRINT OFF
RETURN
Bob Morris
For example, the following PRG prints fine as a stand-alone, yet does not print at all when I include it in the application - all I get is a blank piece of paper ejected. The programs calling this are plain vanilla menus.
I'm baffled. Also, sometimes a report will spool to the printer, but not print until I leave VFP.
Ideas?
===
This prints fine as a standalone but not in the application.
SET DEVICE TO SCREEN
SET PRINT OFF
CLOSE ALL
USE codemstr INDEX cdkey
STORE 0 TO mcount
STORE 1 TO mpage
STORE 65 TO MLINE
STORE msysname TO header1
STORE "Comment Code Master File List" TO header2
SET PRINT ON
SET DEVICE TO PRINT PROMPT
DO WHILE .NOT. EOF()
IF MLINE > 56
@ 1, 0 SAY "Time " + TIME()
@ 1,(80 - LEN (TRIM(mpcname))) / 2 SAY mpcname
@ 1, 65 SAY "Page " + STR(mpage,3)
@ 2, 0 SAY "Date "
@ 2, 5 SAY DATE()
@ 2,(80 - LEN (TRIM(header1))) / 2 SAY header1
@ 3,(80 - LEN (TRIM(header2))) / 2 SAY header2
@ 5, 0 SAY "Code Comment"
STORE mpage + 1 TO mpage
STORE 6 TO MLINE
ENDIF
@ MLINE, 0 SAY cdcode
@ MLINE, 7 SAY cddesc
STORE MLINE + 1 TO MLINE
STORE mcount + 1 TO mcount
SKIP
ENDDO
STORE MLINE + 1 TO MLINE
@ MLINE, 0 SAY "Total "
@ MLINE, 7 SAY mcount PICTURE "999"
EJECT
SET DEVICE TO SCREEN
SET PRINT OFF
RETURN
Bob Morris