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 - say display data at specified device location http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 say                 Display data at specified device location
------------------------------------------------------------------------------
 Syntax
   @ uRow, uCol say xExpr [picture cPicture|function cFunction]

 Arguments
   uRow is the row for the get field.

   uCol is the starting column for the get field.

   xExpr is an expression to convert to a string and display.

   cPicture is a template string that contains function and/or
      template symbols to specify the display format.

   cFunction contains function symbol(s) to format the display.

 Description
   The say command prints xExpr as a character string to the device selected
   in the set device to command. The picture and function clauses
   specify a string which control the appearance of the displayed
   string. Function and template symbols used with these clauses are
   shown in the Picture format table. See the description of the get
   command for more explanation on formatting methods.

   The say command should be only used when formatted output or an
   accompanying get is required. The more efficient ?? command provides
   faster screen output and smaller code size.

   say does not interpret editing, line control or page control characters
   implicitly. For example the tab character, ASCII 9, is not handled as a
   tab. Neither are the carriage return or line feed characters. No
   implicit control is attached to characters presented to say.

   Character strings exceeding the remaining number of column positions on
   the row automatically wrap to the next row. The column position for the
   next row is adjusted to 0. However, say will not scroll the screen.

   say determines the output length of the character string in the following
   priority:

   1. Length of template string; this length overrides the @S function.

   2. @S function. The @S function works if the character string is longer
      than the length specified by @S<n>. Otherwise the @S value is
      ignored.

   3. Length of the unmodified character string.

   Characteristics of a numeric value are considered in the following
   priority to calculate the display width of numerical column:

   1. Width specified in numeric expression.

   2. Width specified by template.

   3. Width of resultant character string if > 10.

   4. Column width set to 10.

   Date data is displayed in 8 or 10 characters, depending on the status of
   the set century flag.

   Logical data is displayed in a width of one column.

 Example
   #define EXAMPLE_IO
   #include example.hdr

   proc Test_say
   vardef
      char    cString
      dbl     ePos, eNeg
      logical lLog
      date    dToday
   enddef
   eNeg    := -123456.78
   ePos    :=  123456.78
   lLog    := .t.
   cString := "Hello world"
   dToday  := today()
   clear
   
   // Template symbols for char
   @ 00, 00 say cString                            // Hello world
   @ 01, 00 say cString picture "AAAAA"            // Hello
   @ 02, 00 say cString picture "AAAAAXXXXXX"      // Hello world
   @ 03, 00 say cString picture "!!!!!!!!!!!"      // HELLO WORLD
   @ 04, 00 say cString picture "AA!!A there"      // HeLLo there
   
   // Function symbols for char
   @ 05, 00 say cString picture "@!"               // HELLO WORLD
   @ 06, 00 say cString picture "@S5"              // Hello
   @ 07, 00 say cString picture "@R (AAAAA)AAAAAA" // (Hello) world
   
   // Template symbols for numeric
   @ 08, 00 say eNeg
   @ 09, 00 say eNeg    picture "$$$$$$$$$.$$"
   @ 10, 00 say eNeg    picture "***,***,***,***.**"
   @ 11, 00 say eNeg    picture "999,999,999.999999"
   
   // Function symbols for numeric
   @ 12, 00 say eNeg    picture "@("
   @ 13, 00 say eNeg    picture "@B"
   @ 14, 00 say ePos    picture "@C"
   @ 15, 00 say eNeg    picture "@X"
   @ 16, 00 say ePos    picture "@Z 999999999.999999999"
   
   // Template symbols for logical
   @ 17, 00 say lLog
   @ 18, 00 say lLog    picture "Y"
   @ 19, 00 say lLog    picture "."
   
   // Function symbols for date
   set date ansi
   @ 20, 00 say dToday                            // yy.mm.dd (ANSI)
   @ 21, 00 say dToday  picture "@D"              // mm/dd/yy (American)
   @ 22, 00 say dToday  picture "@E"              // dd/mm/yy (British)
   wait
   
   clear
   @ 01, 00 say eNeg
   @ 02, 00 say eNeg picture  "***,***,***.****"
   @ 03, 00 say eNeg picture  "@(" // function symbol in picture clause
   @ 04, 00 say eNeg picture  "@X" // another one
   @ 05, 00 say eNeg function "X"  // same as above but using the function clause
   @ 06, 00 say eNeg function "X(" // two function symbols
   @ 07, 00 say eNeg picture  "***,***,***.****"    function "(X" // dual
   @ 08, 00 say eNeg picture  "@( ***,***,***.****" function "X"  // composite
   wait
   endproc

   proc main
   Test_say()
   endproc

See Also: Picture format table get

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