Skip to main content

[Migrated content. Thread originally posted on 20 August 2003]

has anyone noticed a extreme lag when using the below code.

CALL "WIN$PRINTER"
USING
WINPRINT-GET-CURRENT-INFO WINPRINT-SELECTION
GIVING WINPRINT-RESULT.

we are doing two calls as follows

CALL "WIN$PRINTER"
USING WINPRINT-GET-CURRENT-INFO WINPRINT-SELECTION
GIVING WINPRINT-RESULT
CALL "WIN$PRINTER"
USING WINPRINT-GET-SETTINGS MENU-WINPRINT

I've even combined them into one call and it seems to still be slow, and it seems to be on the winprint-get-current-info call.....is there another way to get that info or speed the call up.

[Migrated content. Thread originally posted on 20 August 2003]

has anyone noticed a extreme lag when using the below code.

CALL "WIN$PRINTER"
USING
WINPRINT-GET-CURRENT-INFO WINPRINT-SELECTION
GIVING WINPRINT-RESULT.

we are doing two calls as follows

CALL "WIN$PRINTER"
USING WINPRINT-GET-CURRENT-INFO WINPRINT-SELECTION
GIVING WINPRINT-RESULT
CALL "WIN$PRINTER"
USING WINPRINT-GET-SETTINGS MENU-WINPRINT

I've even combined them into one call and it seems to still be slow, and it seems to be on the winprint-get-current-info call.....is there another way to get that info or speed the call up.
There is no reason that WINPRINT-GET-CURRENT-INFO should cause a delay in itself.
The very first time the Windows printing is accessed, all printers are being enumerated and cached locally to the runtime. This is beneficial for further use. There is however a catch, and that is if you have one or more printers installed that for some reason are off line at the moment. The spooler mechanism of Windows will then hang for a while trying to get information from the offline printer(s).
Assuming this is the case with you, and you are using ACUCOBOL-GT 5.2.1 or newer, check out the configuration switch
WINPRINT-NAMES-ONLY.

Also note that WINPRINT-GET-SETTINGS and
WINPRINT-SET-SETTINGS should not be used in conjunction with WINPRINT-GET-*-INFO or WINPRINT-SET-PRINTER. This also applies for -EX versions.