Show/Hide Toolbars

XSharp

Purpose

Display the results of one or more expressions, separated by a space, in the terminal window.

Syntax

? | ?? [<uValueList>]

Arguments

<uValueList>A list of values to display.  If no argument is specified with the ? statement, a carriage return/linefeed is sent to the terminal window.  If you use the ?? statement without arguments, nothing happens.

Description

? and ?? are synonyms for the QOut() and QQOut() functions, respectively.

Although functionally similar to one another, ? and ?? differ slightly.  ? sends a carriage return/linefeed before displaying the results of the expression list.  ?? displays output at the current position.  This lets you use ?? statements to display successive output on the same line.

 

A ? or ?? statement locates the cursor or print head one position to the right of the last character displayed.  Row() and Col() are updated to reflect the new cursor position.  

 

If output from a ? or ?? statement reaches the edge of the terminal window it wraps to the next line.  If the output reaches the bottom of the window the window scrolls up one line.

To format any expression specified, use Transform().  If you need to pad a variable length value for column alignment, use any of the Pad() functions to left-justify, right-justify, or center the value as illustrated in the examples below.

Examples

This example displays a record from a database file using ? and ?? statements with PadR() to assure column alignment:

 

LOCAL nPage := 0, nLine := 99
USE salesman INDEX salesman NEW
DO WHILE !EOF()
 IF nLine > 55
         IF nPage != 0
                 EJECT
         ENDIF
         ? PadR("Page", LTRIM(STR(++nPage)), 72)
         ?? DTOC(TODAY())
         ?
         ?
         ? PadC("Sales Listing", 79)
         ?
         nLine := 5
 ENDIF
 ? Name, Address, PadR(RTrim(City) + "," + State, 20), ZipCode
 ++nLine
 SKIP
ENDDO
CLOSE salesman

Assembly

XSharp.RT.DLL

See Also

QOut(), QQOut()