Command ?|?? Foundation
Displays the results of a list of expressions on the current output device.
? | ?? [<Expression,...>]
The two commands ? and ?? are output commands. The difference between the two commands is that ? outputs the two control characters carriage-return / line-feed (Chr(13)+Chr(10)) before output of the expression list <Expression,...>. The result is that the output always starts at the beginning of a line. Output from ?? occurs at the current cursor position.
Both commands change the cursor position on the active output device. When the output occurs on the screen, the row and column positions of the screen cursor (as returned by the functions Row() and Col()) change. When the output is sent to a printer (for example, after SET PRINTER ON), the counters for the print head position are updated (as returned by the functions PRow() and PCol()). If <Expression,...> contains more than one expression, the commands ? and ?? both insert a blank space between each of the values output.
The functions QOut() and QQOut() can be used instead of the commands ? and ??. These functions allow output to be performed within a code block. This is often done when screen output should occur during execution of iteration functions like AEval() and DbEval().
// Output of various data types on the screen.
PROCEDURE Main
SetPos( 10, 10 ) // cursor at row 10, column 10
?? .T., 10, "Xbase++" // output begins at 10,10
? Date(), Time(), Seconds() // output begins at 11, 0
RETURN
// The example shows a simple program which
// outputs an address label to the printer using
// ?. The output is re-routed to a text file.
PROCEDURE Main
USE Customer NEW
INDEX ON Upper(LName+Fname) TO CustA
SET PRINTER TO Label.txt
SET PRINTER ON
DO WHILE .NOT. Eof()
? Address
? Trim( FName ), Trim( LName )
? Trim( Street )
? Trim( City ) + ",", State, Zip
EJECT
SKIP
ENDDO
CLOSE Customer
RETURN
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.