Инструкция Print#

Outputs the specified strings or numeric expressions to the screen or to a sequential file.

tip

Use Put# statement to write data to a binary or a random file. Use Write# statement to write data to a sequential text file with delimiting characters.


Синтаксис:

Print syntax


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.

Если точка с запятой или запятая появляется после последнего выражения, которое должно быть выведено, LibreOffice Basic сохраняет этот текст во внутреннем буфере и продолжает выполнение программы без вывода. Когда встречается ещё одна инструкция Print без точки с запятой или запятой на конце, весь текст, который должен быть выведен, выводится вместе.

Положительные числовые выражения выводятся с начальным пробелом. Отрицательные выражения выводятся с начальным знаком минус. Если в процессе превышается определённый диапазон для значений с плавающей точкой, соответствующее числовое выражение выводится в экспоненциальном представлении.

Если выражение, которое должно быть выведено, превышает определённую длину, на экране оно будет автоматически перенесено на следующую строку.

Значок примечания

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.


Пример:

Пожалуйста, поддержите нас!