Have a Question?
Print

00653: Using the ‘FONT’ mnemonic to affect the size of COLS and ROWS

Title:

Using the ‘FONT’ mnemonic to affect the size of COLS and ROWS

Description:

Using the ‘FONT’ mnemonic to temporarily change the font in a document will affect the columns and rows settings. This can occur if font change doesn’t specify a font size. Consider the following alias line and program: 

alias P0 sysprint “Windows System Printer ” setup,SPCOLS=255,CPCOLS=255� 

0010 OPEN (10)”P0″; REM “WIN95 PRINTER OPENED WITH SETUP DIALOGUE 
0020 DIM F0$:TMPL(10,IND=0); LET F0$=FIN(10,IND=0); REM PRINT FATTR(F0$) 
0030 DIM F1$:TMPL(10,IND=1); LET F1$=FIN(10,IND=1); REM PRINT FATTR(F1$) 
0040 LET FONTORIG$=F1.FONT$ 
0045 LET A$=FIN(10); PRINT “Current Columns: “,ASC(A$(3,1)),” Current Rows: “,ASC(A$(4,1)) 
0050 PRINT (10)FILL(255,”1234567890″) 
0060 PRINT (10)’FONT'(“Times New Roman”,24.2857,5),”*123456*” 
0065 LET A$=FIN(10); PRINT “Current Columns: “,ASC(A$(3,1)),” Current Rows: “,ASC(A$(4,1)) 
0070 PRINT (10)’FONT'(FONTORIG$,30,5); REM “RETURN TO ORIGINAL FONT. 
0075 LET A$=FIN(10); PRINT “Current Columns: “,ASC(A$(3,1)),” Current Rows: “,ASC(A$(4,1)) 
0080 PRINT (10)FILL(240,”1234567890″) 

This code prints with the original font, changes to another font, then switches back to the original font. The columns and rows are recalculated in BBx when the font is changed. They will remain the same when the font is switched back if line 70 doesn’t specify the font attributes as in: 

0070 PRINT (10)’FONT'(FONTORIG$); REM “RETURN TO ORIGINAL FONT. 

If line 70 adds the font properties, then the rows and columns will be set appropriately.



Last Modified: 07/10/1998 Product: Visual PRO/5 Operating System: Windows

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

Table of Contents
Scroll to Top