If you happened to have a parallel port and a printer attached to it that wasn't a 'Windows printer', then using OPEN with LPT: works - at least it used to. (Haven't used it since Windows 2000!) It's some time since I had such a printer or even a parallel port.
You then have 3 types of printer options:
- Printing HTML, but remember only a subset of HTML is supported and the font control is weak),
- Using your printer as a graphics device, which requires you to find its metrics, then position everything on the page. The full range of Clearwin+ graphics is available, so you can mix text and graphics, select fonts etc. This is where you get with functions OPEN_PRINTER@ and OPEN_PRINTER1@ (The OpenGL printer options work in the same way - but I've never tried them).
- Using the printer for FORMATted output. This is where you have to use the standard callback PRINTER_OPEN or PRINTER_OPEN1 to a Clearwin+ menu or button, which allows you to associate a Fortran device number with a specific printer (or use the default printer).
In my view, 2 and 3 are a bit topsy-turvy, because unless you have Clearwin+ windows 2 is pointless, and 3 is inaccessible!
SET_PRINTER_ORIENTATION@ sets the initial orientation for the page, but the user can reset this in the printer selection dialog, and your choice cannot be relied upon!
The following is a simple (but awful) example of getting device 99 associated with a printer for FORMATted output.
PROGRAM PRINT
INCLUDE <WINDOWS.INS>
EXTERNAL NULL
I=WINIO@('%ca[Print]Hello World%2nl%6^bt[Print]',
& 'PRINTER_OPEN',99,NULL)
WRITE(99,'('Hello World')')
CLOSE (99)
END
INTEGER FUNCTION NULL()
NULL = 0
RETURN
END
The example uses the standard printer's default font.
Eddie
(But watch the continuation line position of & if you copy the above - it seems to have gained an extra space in front of it).