FIX: "Data Type Mismatch" Error Message Using ASORT()

ID: Q88137

2.00 2.50 2.50a | 2.50 2.50a

MS-DOS          | WINDOWS
kbenv kbprg kbfixlist kbbuglist kberrmsg

The information in this article applies to:

SYMPTOMS

The FoxPro ASORT() function sorts an array into ascending or descending order. When an application uses the ASORT() function, all the elements in the array must have the same data type (character, numeric, date, or logical). Otherwise, the ASORT() function causes a "data type mismatch" error.

NOTE: This bug does not occur in FoxPro for Macintosh.

WORKAROUND

Use the following code to sort the array by the character field:

   USE SYS(2004)+"\Tutorial\INVOICES"
   SELECT cno,idate,ino from invoices INTO ARRAY ainv
   =ASORT(ainv,aelement(ainv,1,1))
   DISPLAY MEMORY

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in FoxPro version 2.5b for Windows.

REFERENCES

Microsoft FoxPro "Commands & Functions" manual, chapter 3 "Commands and Functions, ASORT()"

Additional reference words: FoxDos FoxWin 2.00 2.50 2.50a buglist2.00 buglist2.50 buglist2.50a fixlist2.50b errmsg KBCategory: kbenv kbprg kbfixlist kbbuglist kberrmsg KBSubcategory: FxenvMemory Solution Type : kbfix

Last Reviewed: October 14, 1997