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

Last reviewed: October 14, 1997
Article 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 "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


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 14, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.