Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - ? display values preceded by cr/lf on console http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 ?                   Display values preceded by CR/LF on console
------------------------------------------------------------------------------
 Syntax
   ? [expressions]

 Arguments
   expressions is a comma-separated list of expressions that evaluate
   to any displayable data type.

 Description
   The ? command outputs a carriage return, then the results of each
   expression in the expressions argument list to the screen at the current
   cursor position, or to the printer at the current printer head location.
   Each expression in expressions is separated by a space character.

   The commands set print and set console define where the output
   will occur. The output can also be routed to a text file through the
   set alternate command.

   Force supports columnar formatting with the ?, ??, and ??? commands. Any
   expression printed through these commands may have an optional column
   width field, and if the value displayed is double precision, an
   optional decimal place field.

   Each element in the expressions argument is formatted as follows:

   expr[:width[:decimals]]

   width is the number of columns to display the results of the individual
   expression expr.

   decimals is the number of columns to display decimal place
   values. Any decimal value is right justified, making it easy to
   program a columnar listing of double precision values.

   Any data type may have the corresponding width field. For example,

   ? today():6
   ? arecno(a), a->DblValue:dw[d]:dw[d+1]
   ? eof():40
   ? "A character string":80

   The ? command respects the status of the flags controlled by the
   following commands:

   set alternate       set century
   set console         set decimals to
   set fixed           set margin
   set print           set date

 Example
   #define EXAMPLE_SCREEN
   #include example.hdr

   vardef
      char cVar     := "Formatting test"
      dbl  eNum1    :=  3.1412
      dbl  eNum2    := 33
      dbl  eNum3    := 1234512345.5
      int  iColumns := 10
   enddef
   
   proc Test_465
   clear
   ? "This prints in the second screen line"
   ? "This", "is", "a", "list", "of", "Text"
   ?
   ? "Note the effects of the column width specifications"
   ?
   ? "12345678901234567890  Commands:"
   ? "------------------------------------------"
   ? cVar
   ? cVar:6
   ? eNum1
   ? eNum2
   ? eNum3
   ? eNum1:iColumns + 1
   ? eNum1:5
   ? eNum1:5:3
   ? eNum1:5:3, eNum1:5:2
   
   // The following statements are used to position some
   // explanations on the screen, they do not demonstrate
   // the ? command.
   //
   @  0,  0 ?? "<--- This is the first line (line 0)"
   @  8, 22 ?? "? cVar"
   @  9, 22 ?? "? cVar:6"
   @ 10, 22 ?? "? eNum1"
   @ 11, 22 ?? "? eNum2"
   @ 12, 22 ?? "? eNum3"
   @ 13, 22 ?? "? eNum1:iColumns + 1"
   @ 14, 22 ?? "? eNum1:5"
   @ 15, 22 ?? "? eNum1:5:3"
   @ 16, 22 ?? "? eNum1:5:3, eNum1:5:2"
   @ 18,  0
   endproc

   proc main
   Test_465()
   endproc

See Also: ?? ???

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson