Microsoft KB Archive/58042

= QCARDS Demo Program Incorrectly Searches for Zip Code =

Article ID: 58042

Article Last Modified on 11/21/2006



This article was previously published under Q58042



SYMPTOMS
The QCARDS.BAS demo program shipped with Microsoft QuickBasic Version 4.50 does not search correctly for zip codes. When searching for only a zip code, all cards will match; when searching for zip code and some other field, no cards are found.



STATUS
Microsoft has confirmed this to be a bug in Microsoft QuickBasic version 4.50. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



MORE INFORMATION
To correct this problem, change the following lines from near the end of the FindCard FUNCTION in QCARDS.BAS as indicated: ' Test zip code. SELECT CASE TmpCard.Zip  '**** change to RTRIM$(UCASE$(...)) CASE &quot;&quot;, RTRIM$(UCASE$(Index(Card).Zip)) Found = Found + 1 CASE ELSE END SELECT

' If match is found, set function value and quit, else next card. IF Found = NFIELDS - 1 THEN '**** remove &quot;- 1&quot; after NFIELDS FindCard% = Card EXIT FUNCTION END IF The altered code is as follows: ' Test zip code. SELECT CASE RTRIM$(UCASE$(TmpCard.Zip))     '**** CASE &quot;&quot;, RTRIM$(UCASE$(Index(Card).Zip)) Found = Found + 1 CASE ELSE END SELECT

' If match is found, set function value and quit, else next card. IF Found = NFIELDS THEN                     '**** FindCard% = Card EXIT FUNCTION END IF

Additional query words: QuickBas buglist4.50

Keywords: KB58042

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.