Print# Statement

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.


Syntax:

Print syntax


Print [#filenum,] expression1[{;|,} [Spc(number As Integer);] [Tab(pos As Integer);] [expression2[...]]

Parameters:

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.

Nếu một dấu chấm phẩy hoặc dấu phẩy xuất hiện phía sau biểu thức cuối cùng cần in thì LibreOffice Basic cất giữ văn bản trong một bộ đệm nội bộ và tiếp tục lại thực hiện chương trình mà không in ấn. Khi một câu lệnh « Print » (In) khác không có dấu chấm phẩy hoặc dấu phẩy ở cuối được gặp, toàn bộ văn bản cần in ra được in đồng thời.

Các biểu thức số dương thì được in ra với một dấu cách đứng đầu. Biểu thức âm được in ra với một dấu trừ đứng đầu. Vượt quá một phạm vi nào đó cho giá trị chấm động thì biểu thức số tương ứng được in ra theo kiểu ghi số mũ.

Biểu thức cần in cũng vượt quá chiều dài đã ghi rõ thì ô hiển thị sẽ tự động cuộn đến dòng kế tiếp.

Biểu tượng Ghi chú

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.


Example:

Please support us!