Microsoft KB Archive/88137

{| = FIX: &quot;Data Type Mismatch&quot; Error Message Using ASORT =
 * width="100%"|

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:


 * Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, and 2.5a
 * Microsoft FoxPro for Windows, versions 2.5 and 2.5a

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 &quot;data type mismatch&quot; 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)+&quot;\Tutorial\INVOICES&quot; 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.