Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The Width statement
#1
Since QB64pe has declared full functional QB45 compatible I have posted this snippet:

The QB45 contains Width with Device$

Code: (Select All)
' sample program to set Width statements.
Dim screenwidth As Integer
Dim screenheigth As Integer

Dim widthx As Integer
widthx = 80

screenwidth = 80
screenheight = 25

' reset file width
filenumber = FreeFile
Open "tempfile.xyz" For Output As #filenumber
Width #filenumber, widthx

' reset some printers
Width "lpt1:", widthx
Width "lpt2:", widthx
Width "lpt3:", widthx

' resets some drvies
Width "cons:", widthx
Width "scrn:", widthx

' reset lprint
Width LPrint widthx

' reset screen
'PRINT screenwidth, screenheight
Width screenwidth, screenheight
End

Where:

Code: (Select All)
WIDTH Statement Details  
    
Syntax  
   WIDTH [columns][,lines]  
   WIDTH {#filenumber | device},width  
   WIDTH LPRINT width  
    
Both files and devices can be assigned an output-line width.  
    
  Syntax                    Description  
  WIDTH [columns][,lines]   Sets the number of columns and lines to  
                            display on the screen.  
    
                            The value of columns must be either 40 or  
                            80. The default value is 80.  
    
                            The value of lines may be 25, 30, 43, 50,  
                            or 60, depending on the display adapter  
                            used and the screen mode (see the SCREEN  
                            statement help topic for more information).  
                            The number of lines displayed when the program  
                            started will determine the default value.  
    
  WIDTH #filenumber,width   Sets the line width of an output device opened  
                            as a file (for example, LPT1: or CONS:).  
    
                            The filenumber argument is the number  
                            associated with the file in the OPEN  
                            statement.  
    
                            This form permits altering the width while  
                            a file is open, since the statement takes  
                            place immediately.  
    
  WIDTH device,width        Sets the line width of device (a device file  
                            name).  
    
                            The device should be a string expression  
                            (for example, "CONS:").  
    
                            Note that this width assignment is deferred  
                            until the next OPEN statement affecting the  
                            device; the assignment does not affect output  
                            for an already open file.  
    
  WIDTH LPRINT width        Sets to width the line width of the line  
                            printer, for use by subsequent LPRINT  
                            statements.
Reply


Messages In This Thread
The Width statement - by eoredson - 04-05-2024, 04:43 AM
RE: The Width statement - by Pete - 04-05-2024, 05:19 AM
RE: The Width statement - by SMcNeill - 04-05-2024, 05:30 AM
RE: The Width statement - by Pete - 04-05-2024, 05:41 AM
RE: The Width statement - by eoredson - 04-05-2024, 06:04 AM
RE: The Width statement - by Pete - 04-05-2024, 06:47 AM
RE: The Width statement - by SMcNeill - 04-05-2024, 07:27 AM
RE: The Width statement - by SMcNeill - 04-05-2024, 07:33 AM
RE: The Width statement - by bplus - 04-05-2024, 11:43 AM
RE: The Width statement - by eoredson - 04-05-2024, 11:32 PM
RE: The Width statement - by SMcNeill - 04-06-2024, 12:48 AM
RE: The Width statement - by bplus - 04-06-2024, 12:19 AM
RE: The Width statement - by Pete - 04-06-2024, 01:37 AM
RE: The Width statement - by eoredson - 04-06-2024, 03:32 AM
RE: The Width statement - by TerryRitchie - 04-06-2024, 03:52 AM
RE: The Width statement - by Pete - 04-06-2024, 03:57 AM



Users browsing this thread: 1 Guest(s)