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 - setdbcrstring() define display for '@c' and '@x' picture functions http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 setdbcrstring()     Define display for '@C' and '@X' picture functions
------------------------------------------------------------------------------
 Declaration
   io.hdr

 Syntax
   proc setdbcrstring extern
   param const char(6) cDebit, ;
         const char(6) cCredit

 Arguments
   cDebit is the debit string (maximum 6 characters long).

   cCredit is the credit string (maximum 6 characters long).

 Return
   None.

 Description
   The setdbcrstring() function sets the debit and credit strings
   to be used with the say command. By default, the picture
   functions '@C', and '@X' output a trailing 'CR' together with a
   positive number, or a trailing 'DB' together with a negative number.
   setdbcrstring() allows to change this default by defining new strings.

 Example
   #define EXAMPLE_IO
   #include example.hdr

   proc Test_setdbcrstring
   vardef
      dbl eBalance1, eBalance2
   enddef
   eBalance1 := 1.5
   eBalance2 := -1.5
   clear
   setdbcrstring( "Debit ", "Credit" )  // pad blanks to have equal lenghts
   @ 3, 5 say eBalance1 picture "@C" get eBalance1
   @ 5, 5 say eBalance2 picture "@X" get eBalance2
   read
   endproc

   proc main
   Test_setdbcrstring()
   endproc

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