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 - set exact control the exact flag http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 set exact           Control the exact flag
------------------------------------------------------------------------------
 Syntax
   set exact on|off

 Arguments
   None.

 Description
   The set exact command controls the exact flag. The default value for
   the exact flag is off.

   When set exact is on, two strings are considered equal if one of the
   following conditions is true:

   - Strings are of equal length and contain the same sequence of characters.

   - Right side string contains only spaces from position N to the end of the
   string. Position N is the last non-space character.

   - Left side string contains only spaces from position N to the end of the
   string where position N is the length of the shortest string.

   When set exact is off, strings are compared from the first position
   in both strings. The comparison continues until one of the following
   conditions is true:

   - Strings are of equal length and contain the same sequence of characters.

   - Strings are equal for length of the right side string.

   The == exact comparison operator always performs an exact sring compare,
   without respecting the setting of set exact.

 Example
   #define EXAMPLE_STRING
   #include example.hdr

   proc Test_setexact
   set exact off
   ? "" = "David"              // .F.
   ? "David" = ""              // .T.
   ? "David" = "David    "     // .F.
   ? "David" = "    David"     // .F.
   ? "David Lowrey" = "David"  // .T.
   ? "David" = "David Lowrey"  // .F.
   ? "David" = "david"         // .F.
   ?
   set exact on
   ? "" = "David"              // .F.
   ? "David" = ""              // .F.
   ? "David" = "David    "     // .T.
   ? "David    " = "David"     // .T.
   ? "David Lowrey" = "David"  // .F.
   ? "David" = "David Lowrey"  // .F.
   ? "David" = "david"         // .F.
   endproc

   proc main
   Test_setexact()
   endproc

See Also: = getexact()

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