Have a Question?
Print

00419: Using the CTRL() function to obtain printer information

Title:

Using the CTRL() function to obtain printer information

Description:

The CTRL() function, new to Visual PRO/5, can obtain printer resolution and total printable area. It returns information on the default Windows printer. The CTRL(13) template is as follows: 

WIDTH:U(4) 
HEIGHT:U(4) 
HRES:U(4) 
VRES:U(4) 
XOFF:U(4) 
YOFF:U(4) 

The following code will return the height and width of the printable area and multiply it by 1000 so programming can be done in thousandths of an inch. 

OPEN(1)”X0″ 
PRINT (1)’WINDOW'(30,90,730,446,”Test Window”,$0082$,$03400400$) 
DIM CTRL13$:”width:u(4),height:u(4),hres:u(4),vres:u(4)” 
LET CTRL13$=CTRL(1,0,13) 
LET W=CTRL13.WIDTH*1000 
LET H=CTRL13.HEIGHT*1000 
LET H=CTRL13.HEIGHT 
LET W=CTRL13.WIDTH 
LET W=INT(W*1000/CTRL13.HRES) 
LET H=INT(H*1000/CTRL13.VRES) 
PRINT H,W 



Last Modified: 12/24/1997 Product: Visual PRO/5 Operating System: Windows

BASIS structures five components of their technology into the BBx Generations.

Table of Contents
Scroll to Top