Commands and Statements

Command ?|?? Foundation

Displays the results of a list of expressions on the current output device.

? | ?? [<Expression,...>]
<Expression,...> is a comma-separated list of expressions. Each expression can contain any data type except object. The value of each expression is output on the active output device (usually the screen) starting at the current cursor position. Prior to the first expression (or if <Expression,...> is not included) the command ? also outputs the control characters carriage-return / line-feed (Chr(13)+Chr(10)). This positions the cursor at the beginning of the next output line before output. For each comma in <Expression,...>, a blank space is output.

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().

? and ??

// Output of various data types on the screen. 


   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 


Printing with ?
// The example shows a simple program which 
// outputs an address label to the printer using 
// ?. The output is re-routed to a text file. 


   USE Customer NEW 
   INDEX ON Upper(LName+Fname) TO CustA 

   SET PRINTER TO Label.txt 

   DO WHILE .NOT. Eof() 

      ? Address 
      ? Trim( FName ), Trim( LName ) 
      ? Trim( Street ) 
      ? Trim( City ) + ",", State, Zip 



   CLOSE Customer 


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.