View previous topic :: View next topic |
Author |
Message |
Anonymous Guest
|
Posted: Tue Oct 11, 2005 1:46 am Post subject: Printing from Salford FTN95 application |
|
|
Colleagues,
I am at the last stages of developing an application using Salford FTN95. I am stuck at the stage of trying to print the output from within the application. I haved added a print menu on the output screen and it successfully invokes the printer dialog box. However, when I print, nothing comes out. I guess I need to add some lines that allows the program to read the output on the screen and output it on the printer. Your assistance would be appreciated.
S. Bah |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Tue Oct 11, 2005 1:16 pm Post subject: Printing from Salford FTN95 application |
|
|
If you have a local default printer configured to port LPT1 then you may be able to use the Fortran OPEN command. Then you would not need the Open Printer dialog. Look in FTN95.chm and Search for LPT1 for further information.
Then next simplest approach is described with an example in the FTN95 help file under Win32 Platform/ClearWin+/Using the Printer/Selecting a printer. A quick way to find this is to Search for PRINTER_OPEN. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Tue Oct 11, 2005 3:08 pm Post subject: Printing from Salford FTN95 application |
|
|
I found that using this WINIO@ function call:
IA=WINIO@('%nl%rj%10^bt[&Print]&', 'PRINTER_OPEN', 10,
+ Prin_FUNCTION)
(There is the related stuff from a Menu too)
I was able to connect logical unit No. 10 (lun=10) to a printer (the printer_open call back allows you to select which one via a standard Window). It DOES NOT require a conventional FORTRAN OPEN statement. My user defined call-back function Prin_FUNCTION simply does all the printing with standard formatted Fortran WRITE statements, all directed to lun 10. Just before the RETURN in this function, I issue a CLOSE (10) command, which definitely sends everything to the printer, and frees up the printer for other processes.
There is another standard call back that simply connects you to the default printer - call that one the next time round to save the user the bother of selecting a printer again.
Eddie B. |
|
Back to top |
|
|
|