xHarbour Reference Documentation > Function Reference |
Displays values of expressions to the console window.
QOut( [<expression,...>] ) --> NIL QQOut( [<expression,...>]) --> NIL
The return value is always NIL.
QOut() and QQOut() are text mode functions that display the result of a comma separated list of expressions to the currently selected console output device. This can be the screen, or console window, or the printer.
The difference between QOut() and QQOut() is that QOut() first outputs a carriage-return/line-feed pair so that the output of <expression,...> always begins at a new line, while QQOut() outputs the values of <expression,...> at the current cursor or printhead position.
The QOut() or QQOut() function first locates the current cursor or printhead position and shifts it one to the right. Row() and Col() are updated with the new cursor position if SET PRINTER is OFF, otherwise they are updated with the new printhead position.
Should the output of QOut() or QQOut() reach the right border of the screen (defined by MaxCol()), it will wrap to the next line. Should the output of QOut() or QQOut() reach the bottom border of the screen (defined by MaxRow()), the screen will scroll up one line.
It is possible to output the expression(s) to the printer by using SET PRINTER ON before calling QOut() or QQOut(). It is also possible to output to a text file using the SET ALTERNATE TO command, followed by the SET ALTERNATE ON command. The SET CONSOLE OFF command will prevent display on the screen without interrupting the output to the printer or text file.
When the expression(s) need formatting, use the Transform() function or any user-defined function. For padding, use any of the Pad() functions to center, left align or right align the expression(s).
See also: | ?|??, @...SAY, PadC() | PadL() | PadR(), SET ALTERNATE, SET CONSOLE, SET PRINTER, TEXT, Transform() |
Category: | Output functions |
Source: | rtl\console.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// This example displays a list of expressions: PROCEDURE Main LOCAL var1 := 1, var2 := Date(), var3 := .T. QOut( "This line will be displayed on the console." ) QOut( "This line will be displayed beneath the previous line." ) QQOut( "No carriage return / linefeed for this expression!" ) QOut( var1, var2, var3, "These were variables" ) RETURN
http://www.xHarbour.com