[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
##############################################################################
###+---+######################################################################
#+-| ? |----------------------------------------------------------------+#####
#| +---+ The ? command displays a carriage return and the results of |#####
#| each expression in <Ques-list> to the screen. The display can |#####
#| be routed to a text file through the SET ALTERNATE command. |#####
#+----------------------------------------------------------------------+#####
##############################################################################
##############################################################################
#+--| Syntax |--------------+#################################################
#| ?[?][<Ques-list>] |#################################################
#+--------------------------+#################################################
##############################################################################
##############################################################################
######+---| Description |----------------------------------------------+######
######| The ? command outputs a string to the current cursor position. |######
######| Each expression in <Ques-list> is separated by a space |######
######| character. |######
######| -------------------------------------------------------------- |######
######| [<Ques-list>] |######
######| |######
######| FORCE supports columnar formatting with the ? and ?? commands. |######
######| Any expression printed through the ?/?? commands may have an |######
######| optional column width field, and if the value displayed is |######
######| double precision, an optional decimal place field. |######
######| -------------------------------------------------------------- |######
######| The format of a <Ques-list> is as follows: |######
######| <expression>[:<nwidth expression>[:<decimal expression>]] |######
######| -------------------------------------------------------------- |######
######| The <nwidth expression> is the number of columns to display |######
######| the results of <expression>. <decimal expression> is the |######
######| number of columns to display decimal place values. Any |######
######| decimal value is right justified, making it easy to program a |######
######| listing of double precision values. |######
######| -------------------------------------------------------------- |######
######| Any data type may have the corresponding <nwidth expression> |######
######| field. For example, |######
######| |######
######| ? today():6 |######
######| ? a_recno(a), a->dbl_value:dw[d]:dw[d+1] |######
######| ? eof():40 |######
######| ? "A character string":80 |######
######| -------------------------------------------------------------- |######
######| The ? command respects the status of these flags: |######
######| * SET ALTERNATE * SET CENTURY |######
######| * SET CONSOLE * SET DECIMALS TO |######
######| * SET FIXED * SET MARGIN |######
######| * SET PRINT * SET DATE |######
######| -------------------------------------------------------------- |######
######| Presence of a second ? character suppresses the output |######
######| of a carriage return and line feed. |######
######| |######
######| For example, |######
######| |######
######| ? "an example string" |######
######| |######
######| is identical to |######
######| |######
######| ?? chr(&CR) + chr(&LF) + "an example string" |######
######+----------------------------------------------------------------+######
##############################################################################
##############################################################################
#########+--| Example 1 |-------------------------------------------+#########
#########| * Display a string with a carriage return and |#########
#########| * line feed prepended. |#########
#########| |#########
#########| ? "this will print on the screen" |#########
#########| ?? "at current row+1, column 0." |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 2 |-------------------------------------------+#########
#########| * Display several expressions, each separated |#########
#########| * by the delimiter "," |#########
#########| |#########
#########| ? 3+1, "score and", char_var, .T. |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 3 |-------------------------------------------+#########
#########| * A program to show formatting capabilities |#########
#########| * with character and numeric values. |#########
#########| * Each line within this program illustrates |#########
#########| * a different feature of the ? command. |#########
#########| |#########
#########| VARDEF |#########
#########| CHAR char_var = "formatting test" |#########
#########| DBL number_var = 3.1412 |#########
#########| DBL number_var_2 = 33 |#########
#########| DBL number_var_3 = 1234512345.5 |#########
#########| INT columns = 10 |#########
#########| ENDDEF |#########
#########| |#########
#########| PROCEDURE force_main |#########
#########| |#########
#########| ? "12345678901234567890" |#########
#########| ? char_var |#########
#########| ? char_var:6 |#########
#########| ? number_var |#########
#########| ? number_var_2 |#########
#########| ? number_var_3 |#########
#########| ? number_var:columns+1 |#########
#########| ? number_var:5 |#########
#########| ? number_var:5:3 |#########
#########| ? number_var:5:3, number_var:5:2 |#########
#########| |#########
#########| ENDPRO |#########
#########| Program output: Corresponding line: |#########
#########| |#########
#########| 12345678901234567890 "12345678901234567890" |#########
#########| formatting test ? char_var |#########
#########| format ? char_var:6 |#########
#########| format format ? char_var:6, char_var:6 |#########
#########| 3.1412 ? number_var |#########
#########| 33 ? number_var_2 |#########
#########| 12345123451.5 ? number_var_3 |#########
#########| 3.1412 ? number_var:column + 1 |#########
#########| 3.1412 ? number_var:5 |#########
#########| 3.141 ? number_var:5:3 |#########
#########| 3.141 3.14 ? number_var:5:3,number_var:5:2 |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
########+------------------------------------------------------------+########
########| Example 3 shows several aspects of the ? command with |########
########| numeric and character values. Line 1 shows that character |########
########| expressions are printed at the current cursor position. |########
########| Spaces are not prepended to the expression before it is |########
########| output. These formatting rules are the same for logical |########
########| and date expressions. |########
########| ---------------------------------------------------------- |########
########| The character, date and logical expressions do not imply |########
########| a default column width. To define a column width use the |########
########| <nwidth expression> field in <Ques-list>. See line 2. |########
########| Any string longer than the defined column width will be |########
########| truncated. |########
########| ---------------------------------------------------------- |########
########| FORCE displays numeric values, as in line 5, with an |########
########| implied decimal place at "current cursor position + 11". |########
########| To control the location of the decimal place, use the |########
########| <decimal expression> field in <Ques-list>. |########
########+------------------------------------------------------------+########
##############################################################################
See Also:
@...??
SET CONSOLE
SET DECIMALS TO
SET FIXED
SET PRINT
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson