Clipper Support Bulletin #5
Things you should know

Copyright (c) 1991, 1992 Nantucket Corporation.  All rights reserved.


Version:  Clipper 5.0, revisions 1.00 - 1.03
Date:     10th December, 1990
Revised:  22nd May, 1992
Status:   Active

================================================================================

This Support Bulletin covers the following topics:

   1. Duplicate fields in a COPY TO command
   2. BEGIN SEQUENCE...END with multiple Gets
   3. SET KEY and undefined functions
   4. Translation rules
   5. Displaying long gets
   6. Omitting spaces before macros
   7. TBrowse limit exceeded
   8. Passing color strings by reference to SETCOLOR()
   9. 00/00/00 is an invalid date
       
================================================================================
1.           Duplicate fields in a COPY TO command
   
   When issuing a COPY TO...FIELDS standard command with repeated
   field references, for example:
   
     COPY TO NTest FIELDS FldA,FldB,FldC,FldD,FldB,FldB SDF
   
   Summer '87 created a file containing the following:
   
     FldA,"",FldC,FldD,"",FldB
   
   where "" denotes an empty string.  Notice that an empty string
   appears in place of the repeated field FldB in all but the last
   occurrence.
   
   In Clipper 5.0, the opposite is true.  Empty strings appear in
   place of all except the first occurrence of the field FldB:
   
     FldA,FldB,FldC,FldD,"",""
   
================================================================================
2. BEGIN SEQUENCE...END with multiple Gets
   
   With the introduction of the new Get System in Clipper 5.0, a
   Summer '87 behavior has been removed.  This has to do with the
   visibility of the internal GetList.
   
   The new Get System in Clipper 5.0 stores Get information in a
   public array called GetList.  GetList follows all the usual
   variable scoping rules.  This may cause some Summer '87 code to
   behave differently under 5.0.  Consider the following example:
   
   CLEAR SCREEN
   @ 0,0 SAY "GET...READ with BEGIN SEQUENCE...END test"
   
   BEGIN SEQUENCE
     SET KEY -1 TO FBreak
     x = SPACE(10)
     @ 5,5 GET x
     READ
   END SEQUENCE
   
   y = SPACE(10)
   @ 10,5 GET y
   READ
   RETURN
   
   FUNCTION FBreak
     BREAK
     RETURN (.T.)
   
   When the F2 key is pressed from within the first Get, the function
   FBreak() is invoked.  A BREAK is issued and the second Get is
   painted on the screen.  At this point, Summer '87 code would pass
   control to the second Get; however, Clipper 5.0 code leaves the
   first Get active.  This occurs because GetList is still in scope
   when the second Get is performed, so the new Get is added to it.
   
   To make the second GET active, add the line
   
     GetList := {}
   
   after the first Get and before the second.
   
================================================================================
3. SET KEY and undefined functions
   
   Summer '87 would not generate a link error if an undefined
   function was referenced by the SET KEY command.  In Clipper 5.0,
   an "Unresolved external" error will occur at link time.
   
================================================================================
4. Translation rules
   
   It is possible that omitting spaces in a translation rule may
   cause a compiler error message.  In the following example, spaces
   have not been placed between the result markers and the operators.
   When compiled, this will generate the error message "Error C2061
   Label error in #translate/#command."  For example:
   
   #command DEFAULT <var1> TO <value1> ;
     =>       IF (<var1>==NIL); <var1>:=<value1>; END
   
   The correct way to format this code is like this:
   
   #command DEFAULT <var1> TO <value1> ;
     =>       IF ( <var1> == NIL ); <var1> := <value1>; END
   
   Please use plenty of spaces when you are building your own
   translation rules.
   
================================================================================
5. Displaying long gets
   
   In Summer '87, very long Gets (usually 80 characters or more) were
   wrapped to the lefthand side of the screen. Clipper 5.0 does not
   wrap long Gets.  It was necessary to alter this behavior in
   preparation for resizeable windows in a future version.
   
================================================================================
6. Omitting spaces before macros
   
   Summer '87 accepted the following code as perfectly legal:
   
   @ 5, 5 SAY "Get Variable: " GET&MacroVar
   READ
   
   Clipper 5.0's compiler is stricter, and generates the error "Error
   C2005   Statement not recognized, match failed at: GET&MacroVar'."
   To prevent this error you must change "GET&MacroVar" to "GET
   &MacroVar."
   
================================================================================
7. TBrowse limit exceeded
   
   There is a limit of approximately 200 fields for each TBrowse
   object (the limit for your application could vary slightly
   depending on the size of the fields being displayed).  When this
   limit is reached, the runtime error "Error TBROWSE/0  Limit
   exceeded" is generated.
   
================================================================================
8. Passing color strings by reference to SETCOLOR()
   
   If a color string was passed to the SETCOLOR() function by
   reference, Summer '87 would ignore the "@" sign and would treat
   the string as if it had been passed by value.  However, Clipper
   5.0 ignores the function call completely and does not perform the
   requested color operation.  For example:
   
   nVar = "W/B"
   SETCOLOR(@nVar)   && Clipper 5.0 ignores this function call
   
   Please do not write code that depends on Summer '87's treatment of
   this code.  The behavior that Clipper 5.0 exhibits is standard
   behavior.
   
================================================================================
9. 00/00/00 is an invalid date
   
   Clipper 5.0 does not allow this and generates the runtime error
   "Invalid Date." whenever you specify it.
   

                              *  *  *
