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 - ltoc() convert logical value to string http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 ltoc()              Convert logical value to string
------------------------------------------------------------------------------
 Declaration
   string.hdr

 Syntax
   func char(1) ltoc extern
   param value logical lTrue

 Arguments
   lTrue is the logical value to convert.

 Return
   A string representing a logical value.

 Description
   The ltoc() function expects a logical parameter value (.T. or .F.).
   If the parameter is .T., the function returns the character defined for
   true values (normally "Y"), else the value for false (normally "N") will
   be returned.

   The function respects the settings for the true/false characters which
   might have been defined before with the setlogicmask() procedure.

 Example
   #define EXAMPLE_STRING
   #include example.hdr

   proc Test_ltoc
   vardef
      int n
   enddef
   ? ltoc( .f. )            // print "N"
   ? ltoc( .t. )            // print "Y"
   for n := -5 to 5         // numerics can be applied as logicals
      ? n, ltoc( n )        // print "Y", except when 0 is passed
   next
   endproc

   proc main
   Test_ltoc()
   endproc

See Also: logtostr()

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