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.


Szintaxis:

Print syntax


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

Paraméterek:

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.

Ha a pontosvessző vagy vessző az utolsó kinyomtatandó kifejezés után jelenik, akkor a LibreOffice Basic a szöveget egy belső pufferben tárolja, és nyomtatás nélkül folytatja a program végrehajtását. Ha másik Print utasítás áll a sor végén pontosvessző vagy vessző nélkül, akkor az összes kinyomtatandó szöveg azonnal kinyomtatásra kerül.

A pozitív numerikus kifejezéseket egy szóköz előzi meg nyomtatáskor. A negatív numerikus kifejezéseket mínuszjel előzi meg nyomtatáskor. Ha a lebegőpontos értékek egy adott tartományt túllépnek, akkor az adott numerikus kifejezés exponenciális formában lesz kinyomtatva.

Ha a megjelenítendő kifejezés meghalad egy megadott hosszt, a megjelenítés automatikusan beszúr egy sortörést, és a megjelenítést egy új sorban folytatja.

Jegyzet ikon

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.


Példa:

Támogasson minket!