Instrukcja Print
Wyświetla określone ciągi lub wyrażenia numeryczne w oknie dialogowym.
Print [#filenum,] expression1[{;|,} [Spc(number As Integer);] [Tab(pos As Integer);] [expression2[...]]
filenum: Any numeric expression that contains the file number that was set by the Open statement for the respective file.
expression: Any numeric or string expression to be printed. Multiple expressions can be separated by a semicolon. If separated by a comma, the expressions are indented to the next tab stop. The tab stops cannot be adjusted.
number: Number of spaces to be inserted by the Spc function.
pos: Spaces are inserted until the specified position.
Jeśli po ostatnim wyrażeniu do wyświetlenia znajduje się średnik lub przecinek, LibreOffice Basic przechowuje tekst w buforze wewnętrznym i kontynuuje wykonywanie programu bez wyświetlania. Po napotkaniu następnej instrukcji Print bez średnika lub przecinka na końcu wyrażenia, cały tekst jest wyświetlany jednocześnie.
Dodatnie wyrażenia numeryczne są wyświetlane ze spacją wiodącą. Ujemne wyrażenia numeryczne są poprzedzone znakiem minus. W przypadku przekroczenia określonego zakresu dla wartości zmiennoprzecinkowych wyrażenia numeryczne są wyświetlane w notacji wykładniczej.
Jeśli wyrażenie do wyświetlenia przekracza określoną długość, następuje automatyczne zawijanie wierszy.
You can insert the Tab function, enclosed by semicolons, between arguments to indent the output to a specific position, or you can use the Spc function to insert a specified number of spaces.
Sub ExamplePrint
Print "ABC"
Print "ABC","123"
i = FreeFile()
Open "C:\Temp.txt" For Output As i
Print #i, "ABC"
Close #i
End Sub
Sub ExamplePrint
Print "ABC"
Print "ABC","123"
i = FreeFile()
Open "~/temp.txt" For Output As i
Print #i, "ABC"
Close #i
End Sub