home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / db4bugs.zip / ANOMLY11.TXT < prev    next >
Text File  |  1989-05-31  |  8KB  |  199 lines

  1. ANOMALIES UPLOADED ON 5-31-89
  2.  
  3.  
  4.                                    ANOMALY11.TXT
  5.  
  6.  
  7. The following listing addresses two known anomalies when using
  8. dBASE IV.  Use of these techniques will aid you in avoiding
  9. anomalies that have been reported to our Software Support
  10. Center.  There are also two Usage-Tips that may be used in order
  11. to avoid further problems or misunderstandings when using the
  12. dBASE IV product.  This report will be supplemented as new
  13. information is received.  
  14.  
  15.  
  16. *******************************************************************
  17.  
  18.  
  19.                                    ANOMALIES
  20.  
  21.  
  22. Network install rules out Hardware setup options
  23.  
  24.      Setting Multi-user installation to YES dims Hardware setup
  25.      options which, therefore, become unavailable.  Page 2-4 of
  26.      Network Installation, under the heading "Hardware Setup"
  27.      erroneously instructs the user to Downarrow to the next
  28.      option, Display mode.  
  29.      
  30.      The rationale for making these options unavailable during a
  31.      network installation is simple.  On a multi-user system each
  32.      workstation can have unique hardware requirements. 
  33.      Therefore, each workstation should have its own customized
  34.      CONFIG.DB file.  This requirement is documented later on
  35.      page 2-13 of Network Installation.
  36.      
  37. ====================================================================
  38.  
  39.  
  40. SET FIELDS TO has no ADDITIVE clause
  41.  
  42.      The third line in the third example of the "Processing:
  43.      Relating and Restricting Data" section, page 13-11 of
  44.      Programming with dBASE IV uses an unavailable option with
  45.      the SET FIELDS statement.  The ADDITIVE clause after SET
  46.      FIELDS TO Qty_onhand is not a recognized option.
  47.      
  48.      
  49.      
  50.                               USAGE-TIPS
  51.                                    
  52.  
  53.  
  54. How dBASE compares strings and null values
  55.  
  56.      
  57.      Character comparisons:
  58.      
  59.      In dBASE IV when comparing two values to see if they are the
  60.      same, you may encounter some confusing results.  This is due
  61.      to the way that dBASE IV compares the two values.  Take the
  62.      following examples with EXACT set Off:
  63.      
  64.           "xxx" = "xx"  will be true, but
  65.      
  66.           "xx" = "xxx"  will be false.  
  67.      
  68.      Aren't these two expressions the same ?
  69.      
  70.      Well, as far as dBASE is concerned, these are two very
  71.      different expressions.  This is due to the way that dBASE
  72.      performs the comparison, when EXACT has been turned OFF.  
  73.      
  74.      Let's look at the expression "xxx"="xx":
  75.      
  76.      The way dBASE performs the string comparison is on a
  77.      character by character basis.  In other words, dBASE will
  78.      look at the first character of the value on the right and
  79.      compare it to the first character of the left value.  If
  80.      these characters match, dBASE will check the second
  81.      characters and so on until all of the characters from the
  82.      right hand string have been checked.  If each character
  83.      matched the character in the same position of the string on
  84.      the left, then as far as dBASE is concerned, the two values
  85.      are equal when EXACT has been set off.
  86.      
  87.      If we look at the other example:
  88.      
  89.           "xx" = "xxx"
  90.      
  91.      we can see that we will reach the end of the left string
  92.      before the end of the right string.  Which means that dBASE
  93.      will consider these two values to be different.
  94.      
  95.      You can think of it in the sense of how the $ operator
  96.      works.  The example
  97.      
  98.           "xxx"="xx"
  99.      
  100.      is similar to
  101.      
  102.           "xx"$"xxx" 
  103.      
  104.      where the $ operator means that the string on the left of
  105.      the $ is contained in the string on the right.  The only
  106.      difference being that the $ operator will search the entire
  107.      string, where as the = operator will match position 1 of the
  108.      right hand string to position 1 of the left hand string
  109.      until all of the characters from the right hand string have
  110.      been checked.
  111.      
  112.      NULL Comparisons:
  113.      
  114.      A NULL character is simply an ASCII character with the
  115.      decimal value 0.  On an ASCII chart, the NULL is the very
  116.      first character.  How does dBASE IV compare variables if one
  117.      of the strings contain only a NULL value?
  118.      
  119.      Consider the following examples:
  120.      
  121.           ""=VAR1             && "" is a NULL.
  122.      
  123.      This example will only be true if VAR1 actually contains a
  124.      NULL value.
  125.      
  126.      Remember how dBASE will begin to compare these two strings. 
  127.      If VAR1 is not a NULL then these two strings will not be
  128.      equal.  A NULL on the left of the equal sign is equal only
  129.      to a NULL on the right.
  130.      
  131.      Here's what this whole thing has been leading up to.  In the
  132.      example
  133.      
  134.           VAR1 = ""                && Where VAR1 = "Mark"
  135.      
  136.      dBASE will consider this expression to be true.  Yes, that's
  137.      right.  If a NULL is on the right of the = operator the
  138.      expression will ALWAYS be true.  When dBASE begins to match
  139.      character for character, it will treat the NULL character as
  140.      anything.  So, when dBASE compares the NULL to the 'M' in
  141.      Mark, the two strings are considered to be equivalent.  The
  142.      rule is, when a NULL is on the right hand side of a string
  143.      comparison, it will always evaluate as true because NULL is
  144.      the universal match character.
  145.      
  146.      Dates and NULLS:
  147.      
  148.      Another topic to discuss with regard to NULLS is how to
  149.      check for dates that are blank.  In dBASE an empty date
  150.      field or variable contain a NULL value.  So, how do you
  151.      check for a NULL or empty date ?
  152.      
  153.      The following will LIST all records where DATE1 is blank:
  154.      
  155.           LIST FOR DATE1={}  && {} is an empty or NULL date value
  156.      
  157.      When comparing dates it is not necessary to worry about on
  158.      which side of the = the NULL date should be placed.  Suppose
  159.      you want to LIST records where the DATE1 field contained a
  160.      date.  It would seem that the following would be sufficient:
  161.      
  162.           LIST FOR DATE1<>{}
  163.      
  164.      You will quickly notice that there are no records returned. 
  165.      In order to check for an empty date you need to use the =
  166.      operator.  We should use the following command instead:
  167.      
  168.           LIST FOR .NOT. DATE1={}
  169.      
  170.      This will indeed give us a list of all records that contain
  171.      a date in the DATE1 field.
  172.      
  173. ======================================================================
  174.  
  175.  
  176. Command line arguments
  177.  
  178.      In all versions of dBASE you have the capability of passing
  179.      a start-up program name to dBASE from the DOS command line. 
  180.      The syntax is DBASE <.prg name>.  In dBASE III and above,
  181.      the software allowed the setting of configuration options in
  182.      the CONFIG.DB file.  One option in the CONFIG.DB file is the
  183.      COMMAND = <expC> option, which can be set to initiate any
  184.      command in dBASE when the software is run.  This became an
  185.      alterative to the passing of a program name as a command
  186.      line argument.  However, in dBASE III PLUS, if a COMMAND =
  187.      <expC> option existed in the CONFIG.DB, any command line
  188.      argument passed from DOS would be ignored and only the
  189.      command specified in the CONFIG file would be performed.  
  190.      
  191.      dBASE IV now "restores" the functionality to command line
  192.      arguments even though a COMMAND = <expC> is set in
  193.      CONFIG.DB.  In dBASE IV, if DBASE is called by itself from
  194.      DOS without a command line argument, by simply typing DBASE,
  195.      the command specified in the CONFIG file is performed.  If a
  196.      program name is passed from the DOS command line during the
  197.      start-up of dBASE, that program will be run and the command
  198.      in CONFIG.DB will be bypassed.
  199.