======================================================================
CLIPPER ANOMALY REPORT - Summer '87
Library of: 21 December 1987                    Published:  8 Feb 1988
======================================================================
[*] indicates change or additional entry since Anomaly Report
    of 28 Jan 1988.


[ ] ASORT(get_array)

DECLARE an array, initialize it with numeric data, then do some GETs
into some of them.  When you ASORT() the array, it ASORTs the
elements that were changed by the GETs independent of the other
elements that did not get changed.

Example:

     DECLARE a[5]
     a[1] = 10
     a[2] = 9
     a[3] = 12
     a[4] = 5
     a[5] = 122
     @ 05, 05 GET a[1]     && no change
     @ 06, 05 GET a[2]     && no change
     @ 07, 05 GET a[3]     && no change
     @ 08, 05 GET a[4]     && change to 23
     @ 09, 05 GET a[5]     && change to 34
     READ
     ASORT(a)
     FOR x = 1 TO 5
        ? a[x]             && result: 23, 34, 9, 10, 12
     NEXT
     RETURN


[*]  ASORT(semi-filled array)                                    
     
When you DECLARE an array, fill the first half or so elements with
data, then ASORT() it, the unfilled elements all assume the value of
the last filled one.
     
Example:

    DECLARE arr[5]
    arr[1] = "QW"
    arr[2] = "FD"
    arr[3] = "GH"
    ASORT(arr)
    FOR x = 1 TO 5
        ? arr[x]            && returns: FD, GH, GH, GH, QW
    NEXT
    ? 
    RETURN


[*]  CLEAR Area Greater than Screen

Formerly, for box drawing or clearing, specifying coordinates that
exceeded actual screen width or height resulted in automatic default
to the actual maximums.  The command was then completed.  With this
version, doing so can result in non-execution of that command.
     
Example:

    @ 10, 00 CLEAR TO 20, 80            && does not do anything
    WAIT
    @ 10, 00 CLEAR TO 20, 79            && works!


[*]  ClipperS87 + Disk-cache Utility + Expanded Memory = FAT Damage   
     
The combination of Clipper S87, certain disk caching utilities, and
EXPANDED memory seems to damage the FAT table when trying to open
index files.
     
Workaround:

    disable cache, or
    SET CLIPPER=E000


[ ] Clipper's DIR vs. DOS's DIR                                  
     
Clipper's DIR command differs from DOS's DIR command in the following
way:

     DIR A:          && does not work
     DIR A:*         && does not work
      
Work-around:

     DIR A:*.*       && OK
      
All of these commands work in DOS.
      

[ ] CLIPSORT.TMP - Network Problem

CLIPSORT.TMP, the temporary file created during an indexing of a
large database, affects simultaneous INDEXes of other large DBFs by
different workstations on the same sub-directory, destroying the
index files.  This applies to SORTing large databasese as well.


[ ] Color Settings in DBU and DEBUG

The hard-coded color settings in DEBUG and DBU cause illegibilty on
machines equipped with a CGA color card and a monochrome monitor.

Work-around:

Force monochromatic execution by typing " /m" after the application
name:

     C> CLIP_APL /M


[ ] Command Line Length Limitations

The maximum number of characters that a SET FILTER TO or a LOCATE FOR
command line can have is approximately 270 characters.  The following
compiliation errors may result when a SET FILTER TO has too many
characters:

     "fatal at 0 - invalid procedure mode"

     "fatal at 0 - can't open input"

     "run-time error R6001-null pointer assignment"

     Machine hang!

Example:

     CLEAR
     SET FILTER TO &a01. .AND. &a02. .AND. &a03. .AND. &a04. .AND. ;
                   &a05. .AND. &a06. .AND. &a07. .AND. &a08. .AND. ;
                   &a09. .AND. &a10. .AND. &a11. .AND. &a12. .AND. ;
                   &a13. .AND. &a14. .AND. &a15. .AND. &a16. .AND. ;
                   &a17. .AND. &a18. .AND. &a19. .AND. &a20. .AND. ;
                   &a21. .AND. &a22. .AND. &a23. .AND. &a24. .AND. ;
                   &a25. .AND. &a26. .AND. &a27. .AND. &a28. .AND. ;
                   &a29.
     RETURN


[ ] DEBUG's DOS Shell                                           
     
You cannot invoke DEBUG's DOS Shell once a USE file has been
executed.  If you insist, the machine will hang.
      
Example:

     CLEAR
     ALTD()      && DOS shell OK
     USE dbf
     ALTD()      && DOS shell cannot be invoked
      

[ ] DEBUG - Display/Database Mode
     
When you "quick-key" from a Display/Database mode in DEBUG with the
ALT-G or ALT-S keys, and execute a CLOSE of all open DBFs before the
DEBUGger is invoked again, you fall into an endless loop.
      
Example:

Using DOT.exe, perform the following:
      
     USE a file
     Invoke DEBUG
     Go into DISPLAY/DATABASE mode
     ALT-G
     USE
     Invoke DEBUG again        && grid_lock!
      

[ ] Decimals in Report Forms

When you try to generate a report on an empty database, the decimals,
if any, on a numeric field are not shown, even if specified in the
FRM file.


[ ] FOR...NEXT - LOOP

A LOOP command within a FOR...NEXT takes you to that FOR...NEXT,
rather than to the last DO...WHILE, and acts like a NEXT command.

Example:

      DO WHILE .T.
          ? "in thru: DO...WHILE..."
          FOR x = 1 TO 10
              ? "in thru: FOR...NEXT..."
              IF x = 5
                  ? x
                  LOOP          && goes back to the FOR/NEXT
              END               && and continues on
          NEXT
      END


[*]  GETting .T. into Logical Memory Variable                    
     
Unexpected behavior arises when performing comparisons between
logical memory variables, DBF fields, and constants that have the
value .T.
     
Observations:

    1. a (.T.) FIELD does not equate with (.T.) constant

    2. a (.T.) FIELD does not equate with (.T.) expression

    3. if a (.T.) FIELD is assigned to a MEMVAR, that
       MEMVAR:
            - does not equate with a (.T.) constant
            - does not equate with a (.T.) expression

    4. if a (.T.) constant is assigned to a MEMVAR, that
       MEMVAR:
            - does not equate with a (.T.) FIELD
            - does equate with a (.T.) constant
            - does equate with a (.T.) expression


[ ] INDEX ON - End of File                                            
     
An INDEX ON command now ends at end of file.  Previous versions
took you to the top.  REINDEX, however, still takes you to the
top.

Example:

     INDEX ON fld TO tndx
     ? EOF()               && returns: .T.


[ ] INPUT TO - Expression Error (in Macro)
     
Hitting the carriage-return without entering anything at an
INPUT TO command returns an "expression error (in macro)".
      
Example:

     CLEAR
     INPUT TO x     && hit RETURN for error
      

[ ] INT() - Extra Leading Space

The INT() function places an extra space in front of the number
being INT()ed.

Example:

This example assumes that DBF has a numeric field, NUMFLD, defined
with 5 digits (with or without decimals):

     USE dbf
     ? LEN(STR(numfld))                && returns 5
     ? LEN(STR(INT(numfld)))           && returns 6

     INDEX ON STR(INT(numfld)) TO ntx  && cannot find anything
                                       ** with this index


[*] INTERNAL ERROR x

The following INTERNAL errors have been reported:

Internal Error 1:

    Restoring from a .MEM file created by dBASE III ver 1.1
      (or AUT86 ?)

    Returning from a DO routine (?)

    On a DO command
     
    All of the above seem to be related with one additional
    condition.  A user reported that to reproduce this internal
    error, you should:

         1. have a RAM-RESIDENT program in memory,
         2. RESTORE FROM a MEM file that was created
               with dBASE v1.1, or Clipper A86,
         3. DO a routine and RETURN from it...

    We were unable to reproduce this.

Internal Error 5:

     Clipper is set to use expanded memory and there is other
     software using some part of that memory  (This report had
     expanded memory being used for CACHEing.  It was fixed by SETting
     CLIPPER=E000).

     Got this when trying to open an index file, without any special
     hardware configuration involved.
     

Internal Error 6:

     Memory allocation error

Internal Error 14:

     IRMA board (3270 emulation) + Sidekick

Internal Error 16:

     Using a corrupted DBF

Internal Error 19:

     Using an index that was not re-created in Summer '87.
     Has occurred upon CLOSE DATA.

     
Internal Error 21:

    One reproducible case for this error is the following:

      1. link your application with the NDX.OBJ option
      2. USE a database file
      3. INDEX on any field
      4. now SEEK, specifying a target of a different type
          than that of the file's key expression
     
      Example:

           * link with NDX.OBJ
           USE dbf
           INDEX ON character_field TO ndx1
           SEEK 1234                           && error 21


[ ] LOCATE FOR Multiple Macros                                  
     
When you LOCATE FOR multiple_macros which are not dot-terminated, the
system hangs.
      
Example:

     macro1 = "FLD = `HERE'"
     macro2 = "FLD = `THERE'"
     LOCATE FOR &macro1 .AND. &macro2     && hang!
      
Work-around:

Dot-terminate the macros:
      
     LOCATE FOR &macro1. .AND. &macro2.


[ ] MEMO Field - Type Mismatch

When you concatenate a MEMO field with a character string, a "type
mismatch" error results.

Example:

     char_var = "Say what?"
     ? memo_field + char_var


[ ] MEMOEDIT() - Window Size
     
When you type a string that traverses the full width of a small
MEMOEDIT() window and wraps into the next line, then save it, a
re-display of that string in a wider MEMOEDIT() window shows a space
break where it automatically wrapped in the smaller window.
      
Example:

     narrow window:      wider window:
          
     |           |       |                       |
     |qwertyuiopa|   =   |qwertyuiopa sdfg       |
     |sdfg       |       |                       |
     |           |       |                       |
      

[ ] MEMORY(0) and SET CLIPPER=X                                   
     
The MEMORY(0) function does not adjust properly with respect to "SET
CLIPPER=Xnnn."  If you increase the "X" value, MEMORY(0) increases
with it by almost the same amount.


[ ] NETNAME() - Null
     
NETNAME() does not return anything.
      
Work-around:

Call Nantucket Support for the NET_NAME() assembler UDF, or
download it from the Nantucket Private Network - Reference
Notes/Networking Notes on The Source.


[ ] Numeric ALIASes                                             
     
You can no longer refer to a field by its numeric alias.  Attempting
to do so produces unpredictable results.
      
Example:

     SELECT 2
     USE dbf2
     GO 1
     SELECT 1
     USE dbf1
     GO 1
     ?
     ? dbf1->fld, dbf2->fld          && FROM_1, FROM_2
     ? a->fld, b->fld                && FROM_1, FROM_2
      
     ? 1->fld, 2->fld                && FROM_2, FROM_2
     ?
     RETURN


[ ] PACK - Corrupting Records

The PACK command corrupts some records in the DBF.  This happens
only when no index files are opened.  The DBF must be at least 64K;
the corrupted records are found at every 64K bytes.

Work-around:

Open an index file before issuing the PACK command with SET INDEX TO
or USE...INDEX.  Or execute COPY TO tempfile FOR .NOT. DELETED(), then
delete the original file and rename the tempfile to the original file's
name.


[ ] PCOL()

The PCOL() function no longer reflects any horizontal change on the ?
print statements.

Example:

     SET PRINT ON
     ? "012345", PROW(), PCOL()     && prow = 1
                                    ** pcol = 0


[ ] PICTURE "@B"
     
The "@B" option (left-justified numerics) for the PICTURE
clause does not conform well with punctuated numeric fields.
      
Example:

     x = 0
     @ 5, 5 SAY "Enter: " GET x PICTURE "@B 9,999.99" 
                                          ** thrown off
     READ


[ ] PICTURE "@XC"

The "@XC" option of the PICTURE clause does not display anything for
a positive (+ve) number.  It displays both "CR" and "DB" for a
negative (-ve) number.

Example:

     CLEAR

     xx = 22
     yy = -22
     @ 03, 05 SAY xx PICTURE "@CX"     && returns: 22
     @ 07, 05 SAY yy PICTURE "@CX"     && returns: 22 CR DB
     ? TRANSFORM(xx, "@CX")            && returns: 22
     ? TRANSFORM(yy, "@CX")            && returns: 22 CR DB
     RETURN


[ ] PLINK86-Plus and LIB Overlay

When creating overlays (internal or external) at link time, if you
include "OVERLAY" in the "LIB" directive, you will get a BAD FIXUP
COUNT IN SECTION... error.  Attempts to execute the resulting EXE
hang the machine.

Example:

     FILE main, etc...
     LIB \clipper\clipper, \clipper\extend, \clipper\overlay

Work-around:

Do not include OVERLAY in the LIB directive.  You can either place
the OVERLAY.LIB in the current directory, or SET OBJ and SET LIB to
the directory holding the libraries.


[ ] Printing Incompatibility with Autumn '86
     
The SET DEVICE TO PRINT command no longer obeys "non-print-exclusive"
coordinates.
      
Example:

     SET PRINT ON
     SET DEVICE TO PRINT
     ? "sep"
     @ PROW(), 3 SAY "arated"     && output: sep   arated
      
Work-around:

     @ PROW(), PCOL() SAY "arated"


[ ] RANGE - DBF Field
     
The RANGE clause returns a "type mismatch..." error if you try to GET
into a DBF field.  This problem occurs with DBF fields only.  GETting
into a memvar is OK.
      
Example:

     @ 5,5 SAY "Enter: " GET dbf_fld RANGE 1, 10     && error
     READ


[ ] RANGE - Version Incompatibility

If you initialize a memvar to a value outside of the RANGE clause,
that value is accepted by the RANGE.  dBASE also allows this, but
Clipper Autumn '86 does not.

Example:

    x = 1
    @ 5,5 SAY "Enter: " GET x RANGE 5, 10
    READ

In the code above, the x field shows 1.  If you hit the return key,
it is accepted.


[ ] RELEASE

This has existed since Clipper Winter '85.

Once a variable that is established in the highest procedure is
released, it should be completely released, so that if a lower
procedure establishes a variable with the same name, it is released
upon RETURNing from that procedure.

Example:

     CLEAR
     f1 = 10        && establish memvar
     RELEASE f1     && kill memvar
     DO proc1       && call sub-procedure
     ? f1
     RETURN

     PROCEDURE proc1
        f1 = 20     && re-establish memvar
     RETURN         && the memvar SHOULD BE released here


[ ] REPORT FORM -  Sub-subtotal

The REPORT FORM command does not sub-subtotal.


[ ]  REPORT FORM + "HEADER" option
     
If the HEADER option is used in the REPORT FORM command, the header
specified is not what gets printed.  Rather, the name of the report
form file is printed.
      
Example:

     REPORT FORM treport HEADER "HELLO THERE"
      
In the above command, "HELLO THERE" is not printed as the
header.  Rather, "treport" is printed.
      

[ ] RESTSCREEN()ing One Line                            
     
You cannot RESTSCREEN() one line of screen that was previously saved
by SAVESCREEN().
      
Example:

     x = SAVESCREEN(10, 10, 10, 50)     && from row 10 to row 10
     CLEAR
     RESTSCREEN(10, 10, 10, 50, x)      && nothing...


[ ] RL.EXE - Cosmetics
     
The field that displays the Total Number of fields of an existing FRM
file displays it in floating format, rather than integer.


[ ] RL.EXE  - Endless Loop                                       
     
You cannot get out of the LAYOUT and GROUPS pages by entering a
string, long enough to "overflow," in the LAST GET field.  Doing so
takes your cursor to bottom-left corner and leaves you in an infinite
loop.
      
Other observations:
      
If the last key hit for that last GET field was a normal "exiting"
key (RETURN, PGDWN, PGEUP, ESC), then everything is OK.  If a
function key was hit, this, too, is OK.


[ ] RUN Command - "RUN Error"

Under variable conditions, the RUN command has not worked.  When it
does not work, the "RUN error" message normally appears.

Observations:

If you have expanded memory in your machine, the problem may
disappear by SETting CLIPPER to the correct "R" value and setting "E"
to zero (0).


[*]  SAVE SCREEN / RESTORE SCREEN through a Field
     
If you save screens to a DBF, close it, then reUSE and restore from
that field, the restored screen will have garbage in it, or the
machine may hang.  The DBF must have more than one record in it.
     
Example:

    GO 2
    SAVE SCREEN TO mem_var
    REPLACE dbf_fld WITH mem_var
    USE screen
    GO 2
    RESTORE SCREEN FROM dbf_fld         && bingo!


[ ] SAVESCREEN() - Greater Than 4K at Times

The SAVESCREEN() function, at random, may save much more than the
amount of screen you really wnat to save.  It can even be greater
than 4K.


[ ] SCROLL()ing 1 line                                          
     
The SCROLL() function does not apply to one line clearing. It also
does not apply to one column scrolling.
 
Example:

     SCROLL(10, 10, 10, 60, 0)       && does NOT clear
      
     SCROLL(10, 10, 15, 10, 1)       && does NOT scroll
      

[*]  SET CLIPPER=S1 Only Partially Effective
     
The `S1' option of the SET CLIPPER environment setting only clears
about three-quarters of the screen of snow.  The left side of the
screen still gets snow.
    
Currently, if you SET CLIPPER=S1 on a monochrome hardware
configuration, the machine will hang upon execution of a S87 compiled
Clipper application.


[ ] SET EXACT ON - SEEK

SET EXACT ON does not have any effect on the SEEK command.

Example:

    SET EXACT ON
    SEEK "ABC"      && if "ABC" does not exist, it
                    && goes to "ABCDE" instead of EOF


[ ] SET FILTER and SET RELATION

A relation set in one area will cause an existing filter in the
other related area to lose its expression identifier, unless preceded
with its alias.

Example:

     CLEAR
     SELECT 1
     USE dbf1
     INDEX ON fld1 TO ntx
     SET FILTER TO fld1 = "AAAAA"

     SELECT 2
     USE dbf2
     SET RELATION TO fld2 INTO dbf1
     LIST fld2, dbf->fld1    && error occurs here
                             ** "undefined identifier (in filter)..."

Work-around:

Include alias for filter identifier:

     SET FILTER TO dbf1->fld1 = "AAAAA"


[ ] SET FILTER TO a Logical Field

If you SET FILTER TO a "logical field = .T.", everything is screened
out.

Example:

    SET FILTER TO logical_fld
    LIST logical_fld            && returns: 10 records

    SET FILTER TO logical_fld = .T.
    LIST logical_fld            && returns: 0 records


[*]  SET FIXED ON - Picture Clause
     
If you:
     
    1- SET DECIMALS to a number greater than the decimal
         configuration in your DBF
    2- SET FIXED ON
    3- assign a numeric FIELD to a MEMVAR
    4- then do a GET on that MEMVAR with a PICTURE clause
         that does not accomodate for the decimals

the machine will hang.
     
Example:

Assume DBF having numeric field NUMFLD; Width equals two with no
decimals:
     
    SET DECIMALS TO 2
    SET FIXED ON
    USE dbf
    memvar = numfld
    @ 5,5 SAY "Enter: " GET memvar PICTURE "99"     && hang!
    READ


[ ] SET MESSAGE TO - Blanking out Line
     
There is a minor incompatibility with Autumn '86 with the MENU TO
command.  Previously, the entire line to which the SET MESSAGE TO
command pointed, was deleted for every message.  Now, it deletes up
to the farthest column reached by the longest message string.  This
applies only when the "CENTER" option is not used.
      

[ ] SORT - Dbf with Dbt                                       
     
If you SORT a DBF that has an associated DBT file, the target DBT
file is truncated to 512 bytes.
      
Example:

     *****
     * dir of DBF1 = DBF      33539 bytes
     *               DBT     168985 bytes
     *
     USE dbf1
     SORT ON fld TO dbfsrt
     *
     * dir of DBFSRT = DBF    33538 bytes
     *                 DBT      512 bytes
     *****
      
Work-around:

Proceed with the SORT, then use the COPY FILE command to copy the
original DBT over the target DBT.  Note that with this workaround,
even if you SORT with a FOR condition, you are still copying the
whole DBT.)


[ ] STR() on FOR...NEXT with SET FIXED and SET DECIMALS

The STR() function does not accomodate the decimals part of a number
generated by a FOR...NEXT loop, even with SET DECIMALS and SET FIXED
ON.

Example:

     CLEAR
     SET DECIMALS TO 2
     SET FIXED ON

     FOR x = 1 TO 10
        ? "LEN(STR(x)).......: ", LEN(STR(x)), "<---"
     NEXT

     x = 0
     DO WHILE x <> 10
        x = x + 1
        ? "LEN(STR(x)).......: ", LEN(STR(x)), "<---"
     ENDDO
     RETURN


[*]  SUM (Decimals - where are they?)                            
     
For some operations, like the SUM command, the DECIMAL configurations
of the DBF are being ignored.
     
Example:

If you have a DBF that has a numeric field with decimal
configurations and you do a SUM on it, you will only get the sum of
the integer part, and no decimals:
     
                 NUMFLD
         rec1:   11.00
         rec2:   11.11
         rec3:   11.00
     
         SUM to X
         ? X                     && returns: 33


[ ] VAL() - Asterisk Overflow                                   
     
The VAL() function requires that a decimals-only string be preceded
with a "0".  Otherwise a numeric overflow is returned.
      
Example:

     ? VAL(".11")       && returns: ***
     ? VAL("0.11")      && returns: 0.11
     x = ".11"
     y = "0.11"
     ? VAL(x)           && returns: ***
     ? VAL(y)           && returns: 0.11

--End--
