VB6Runtime / Library / File / print

VB6 Library Reference

VB6 Print # statement syntax: - Print #filenumber, [outputlist] Writes display-formatted data to a sequential file. The Print # statement syntax has these parts:

Part Description
filenumber Required. Any valid file number.
outputlist Optional. Expression or list of expressions to print.

Remarks

Examples

' Basic usage
Print #1, "Hello World"
' Multiple items
Print #1, x, y, z
' With semicolon separator
Print #1, "Name: "; userName; " Age: "; userAge
' Blank line
Print #1,
' Variable file number
Dim fileNum As Integer
fileNum = FreeFile
Print #fileNum, data
' Complex expressions
Print #1, Format$(Now, "yyyy-mm-dd"), totalAmount

Reference

← Back to File | View all functions