Repository navigation
Lprint
Home › Miscellaneous Keywords › LPrint
Writes text to the default printer.
LPrint [ Using formatstring,] [expressionlist] [(, | ;)] ...formatstringexpressionlist
Prints expressionlist to the printer attached to the parallel port LPT1, or if it does not exist, to the default printer. To print to a printer different from the default one, use Open Lpt.
The Using clause formats expressionlist according to formatstring. Except an UDT, any data type can be passed to LPrint expressionlist, expressions do not need to be first converted to strings.
Using a comma (,) as separator or in the end of the expressionlist will place the cursor in the next column (every 14 characters), using a semi-colon (;) won't move the cursor. If neither of them are used in the end of the expressionlist, then a new-line will be printed.
Some printers will not print at all until a Chr(12) (End of Page) character is printed.
Internally, FreeBASIC uses the special file number -1 for printing using LPrint. This file number may be safely closed using Close -1. The next use of LPrint will automatically reopen it as needed.
- None
-
LPrintis not supported in the -lang fb dialect. In this dialect the printer must be properly opened withOpen LptandPrint #must be used to print.
'' Compile with -lang fblite or qb
#lang "fblite"
'' new-line
LPrint "Hello World!"
'' no new-line
LPrint "Hello"; "World"; "!";
LPrint
'' column separator
LPrint "Hello!", "World!"
'' end of page
LPrint Chr$(12)Category: Miscellaneous Keywords
Kind: keyword
Reproduced from the FreeBASIC Wiki Manual under the GNU Free Documentation License 1.3 — with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. Copyright © the FreeBASIC project and wiki contributors. See License.
tiko-lang · Home · Feature Index · Keyword Index · License
FreeBASIC manual pages reproduced under the GNU FDL 1.3.
- Generics
- Interfaces
- For Each
- Iterators
- Tuples
- Array Results
- Defer
- Lambdas
- Block Strings
- Partial Types
- String Slices
- Embed
- Typed Variadics
- C Header Import
- Foreign Library Linking
- UString
- Fixed-Width Types
- Nullptr
- String Library
- Format
- Array
- Map
- Set
- LinkedList
- OrderedMap
- OrderedSet
- Sorting
- Optional
- Result
- Smart Pointers
- Date and Time (Chrono)
- Filesystem
- File Streams
- Config (INI and TOML)
- Codec
- Hash
- UUID
- OS
- Process
- Net
- HTTP and TLS
- Math Library
- Finance
- Logging
- Terminal TUI Library
- PsControls
- tkControls
- sys/win
- Goroutines and Channels
- LLVM Backend
- tiko build
- TIKO_COMPILER
- Variable Declarations
- Standard Data Types
- User Defined Types
- Procedures
- Operators
- Control Flow Statements
- Converting Data Types
- Array Functions
- String Functions
- Mathematical Functions
- Bit Manipulation
- Date and Time Functions
- File I/O Functions
- Console Functions
- User Input (Runtime Library)
- User Input Functions (Graphics Library)
- Screen Functions
- 2D Drawing Functions
- Graphics Library Reference
- Graphics Keyword List
- Memory Functions
- Threading Support Functions
- Error Handling Functions
- Operating System Functions
- Preprocessor
- Intrinsic Defines
- Miscellaneous Keywords
- Modularizing