BUG: Using CNTPAD() and SET COMP ON Returns Incorrect Value

Last reviewed: June 27, 1995
Article ID: Q124354
The information in this article applies to:
  • Microsoft FoxPro for Windows, version 2.6a

SYMPTOMS

Using CTNPAD() with SET COMP ON results in an incorrect return value.

WORKAROUNDS

Use the SET COMP OFF command instead; it results in a correct value. Otherwise, simply subtract 1 from the value being returned. In the example provided below you could substitute the line:

   wait WINDOW str(cntpad('xmain'))

with:

   wait WINDOW str(cntpad('xmain')-1).

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Behavior

In the following example program, CNTPAD() should return 2, which it does when SET COMP is OFF. But if SET COMP is ON, CNTPAD() returns 3.

clear DEFINE MENU xmain

DEFINE PAD p1 OF xmain PROMPT "pad1" COLOR SCHEME 3 DEFINE PAD p2 OF xmain PROMPT "pad2" COLOR SCHEME 3 ON PAD p1 OF xmain ACTIVATE POPUP pad1 ON PAD p2 OF xmain ACTIVATE POPUP pad2

DEFINE POPUP pad1 MARGIN RELATIVE SHADOW COLOR SCHEME 4 DEFINE BAR 1 OF pad1 PROMPT "bar1 p1"

DEFINE POPUP pad2 MARGIN RELATIVE SHADOW COLOR SCHEME 4 DEFINE BAR 1 OF pad2 PROMPT "bar1 p2"

ON SELECT BAR 1 OF pad1 do tempk

ON SELECT BAR 1 OF pad2 do tempk

ACTIVATE menu xmain

proc tempk wait WINDOW str(cntpad('xmain')) return


Additional reference words: FoxWin 2.60a buglist2.60a
KBCategory: kbprg kbbuglist
KBSubcategory: FxprgGeneral


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: June 27, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.