Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
WIDTH Statement Example
◄Example► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
' This example uses the WIDTH statement to set different widths for File #1
' (a terminal on COM1).
' To try this example:
' 1. Choose New Project from the File menu
' 2. Copy the example code below to the code window
' 3. Press F5 to run the example
CLS ' Clear the screen
' Open the port at the proper baud rate.
OPEN "COM1:9600,N,8,1,ASC,LF" FOR OUTPUT AS #1
Test$ = "1234567890" ' Set up a test string
WIDTH #1, 3 ' Change width to 3
PRINT #1, Test$
WIDTH #1, 4 ' Change width to 4
PRINT #1, Test$
SLEEP 3 ' Delay three seconds so you can observe
' the results on the terminal
CLOSE #1 ' Close the file