? | ?? Command

Evaluates expressions and displays the results.

? | ?? Expression1 [PICTURE cFormatCodes] | [FUNCTION cFormatCodes] | 
   [VnWidth] [AT nColumn] 
   [FONT cFontName [, nFontSize] [STYLE cFontStyle | Expression2]]
   [, Expression3] ... 

Parameters

  • ? Expression1
    Evaluates the expression specified by Expression1 and sends a carriage return and line feed before the expression results. The results are displayed on the next line of the main Visual FoxPro window or the active user-defined window and printed at the left margin of a page, unless a function code cFormatCodes or the _ALIGNMENT system variable specifies otherwise.

    If you omit the expressions, a blank line is displayed or printed. A space is placed between expression results when multiple expressions are included.

  • ?? Expression1
    Evaluates the expression specified by Expression1 and displays the expression results on the current line at the current position of the main Visual FoxPro window, an active user-defined window, or the printer. A carriage return and line feed are not sent before the results.

  • PICTURE cFormatCodes
    Specifies a picture format in which the result of Expression1 is displayed. cFormatCodes can consist of function codes, picture codes, or a combination of both. You can use the same codes available in the Format Property and InputMask Property.

    Function codes affect the overall format of the result; picture codes act on individual characters in the result. If function codes are used in cFormatCodes, they must appear before the picture codes and they must be preceded by @. Multiple function codes with no embedded spaces can immediately follow @. The last function code must be followed by one or more spaces. The space or spaces signal the end of the function codes and the start of the picture codes.

  • FUNCTION cFormatCodes
    Specifies a function code to include in ? and ?? output. If the function clause is included, do not precede the function codes with @. Function codes must be preceded by @ when included in PICTURE.

  • VnWidth
    Specifies a special function code that enables the results of a character expression to stretch vertically within a limited number of columns. nWidth specifies the number of columns in the output.

    ? 'This is an example of how the V function code works.' ;
       FUNCTION 'V10'
    
  • AT nColumn
    Specifies the column number where the output is displayed. This option makes it possible for you to align output in columns to create a table. The numeric expression nColumn can be a user-defined function that returns a numeric value.

  • FONT cFontName [, nFontSize]
    Specifies a font for ? | ?? output. cFontName specifies the name of the font, and nFontSize specifies the point size. For example, the following command displays the system date in 16-point Courier font:

    ? DATE( ) FONT 'Courier',16 
    

    If you include the FONT clause but omit the point size nFontSize, a 10-point font is used.

    If you omit the FONT clause and ? | ?? output is placed in the main Visual FoxPro window, the main Visual FoxPro window font is used for the output. If you omit the FONT clause and ? | ?? output is placed in a user-defined window, the user-defined window font is used for the output.

    • If the font you specify is not available, a font with similar font characteristics is substituted.
  • STYLE cFontStyle
    Specifies a font style for ? | ?? output. If you omit the STYLE clause, the Normal font style is used. If the font style you specify is not available, a font style with similar characteristics is substituted.

    Note   You must include the FONT clause when you specify a font style with the STYLE clause.

    The font styles you can specify with cFontStyle are as follows:

    Character Font style
    B Bold
    I Italic
    N Normal
    O Outline
    Q Opaque
    S Shadow
    - Strikeout
    T Transparent
    U Underline

    You can include more than one character to specify a combination of font styles. For example, the following command displays the system date in Courier Bold Italic:

    ? DATE( ) FONT 'COURIER' STYLE 'BI'
    

Remarks

? and ?? evaluate expressions and send the results to the main Visual FoxPro window, an active user-defined window, or the printer.

If SET PRINTER is ON, the expression results are directed to the printer and the main Visual FoxPro window or an active user-defined window. If SET PRINTER is ON and SET CONSOLE is OFF, the results are directed only to the printer.

Example

? 15 * (10+10)
? 'Welcome to ' PICTURE '@!'
?? 'Visual FoxPro'

See Also

??? Command |@ ... SAY Command | SET MEMOWIDTH Command | SET PRINTER Command | SET SPACE Command | Format Property | InputMask Property