Print Functions, Direct_Print (OpenInsight 64-bit)
At 23 MAY 2023 01:15:36AM Matthew Crozier wrote:
Hi,
Just confirming in case I've missed something -
The Print functions have not been ported over to OI10, and Direct_Print() has no equivalents for Print_SetFont, Print_SetHeader, and Print_SetFooter - right ?
If so, then is there any suggested way of refactoring OI9 code using the Print functions generically? (without parameterising escape codes for specific printers :/ )
Cheers, M@
At 23 MAY 2023 07:08AM Carl Pates wrote:
Hi M@,
I'm not 100% what you're after here - I probably have too much blood in my caffeine stream. Are we talking about something like wrapping the old Print functions around OIPI? Where are the escape codes coming into this - are you using them with the Print functions? Will OIPI not support something you were doing with the Print functions?
Cheers
At 23 MAY 2023 10:16AM Mike Ruane wrote:
M@-
The Printer functions, which came out of the old printer.dll, haven't really been supported since we purchased OIPI and put it into OpenInsight as native calls. They were not ported to OI 10.
DirectPrint still wprks and is supported.
Mike
At 23 MAY 2023 04:44PM Matthew Crozier wrote:
Thanks, and sorry for not being clear. We have some processes that can print out simple reports just using the Print functions, and they use the Print_SetHeader function to automatically place a consistent header on each page. However there doesn't seem to be a way of doing this with Direct_Print, at least automatically. It seems you have to know the printer and its escape codes to replicate some of the Print functions.
Interestingly, the backward compatible Printer and Print statements, which have been there for decades, still work in OI10. I think the Print functions superseded those.
We'll most likely do away with direct printing and instead just save output to a file, which seems much more useful these days.
Cheers, M@
At 24 MAY 2023 04:56AM Carl Pates wrote:
Hi M@,
With Direct Print you are indeed responsible for everything - you bypass all of the GDI functionality so you can get to the internals of the printer itself. Welcome back to the 80s :)
The old Basic+ Printer/Print statements had to be brought forward because they are part of the RBasic/Basic+ language itself, so that's why they are still in v10, even though they were deprecated eons ago.
So, I see why you're asking about the Printer.Dll functions, but it seems like something that OIPI would be able to handle. Is there any reason for not using this? (Curiosity and all ;) )
Cheers
At 24 MAY 2023 04:53PM Matthew Crozier wrote:
it seems like something that OIPI would be able to handle. Is there any reason for not using this? (Curiosity and all ;) )
Ah, perhaps OIPI was the something I was missing! I just had the impression that would be overkill for a simple process dump - but it's not really. All of our OIPI reports are quite complex. Thanks Carl - just needed a mind shift ;)
Then again, the idea of sending process output directly to a printer seems a bit 80's too. As we need to refactor this anyway, we're better off just saving it off to a file, I think.
Cheers, M@