BUG: "Missing )" Error Message Produced by Valid Expression

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

SYMPTOMS

A "Missing )" error message is produced when a valid expression is used with an ON routine such as ON ERROR or ON KEY LABEL.

CAUSE

The algorithm that parses expressions used with an ON routine cannot parse expressions that exceed 255 characters in length.

RESOLUTION

Rearrange the code so that a short expression is placed after the ON routine. For example, instead of this:

   ON ERROR <FoxPro Code Here>

restructure the statement so a function that contains the code is called:

   ON ERROR =myfunction()
   FUNCTION myfunction
      <FoxPro Code Here>
   RETURN .T.

See the "Steps to Resolve Problem" section in this article for an example.

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 Problem

  1. Create the following procedures and functions inside a file called ETEST.PRG:

    PROCEDURE ctest

          WAIT WINDOW "done test"
    

    RETURN

    FUNCTION vlog PARAMETERS one,two RETURN ""

    FUNCTION ccallstk PARAMETERS one,two RETURN ""

  2. Place the following code in a file called ESTART.PRG:

    ON ERROR =vLog( 'FATAL', ;

                'FoxPro error #' + ltrim( str( error() ) ) + ;
                 ': ' + message() + chr( 13 ) + chr( 10 ) + chr( 13 ) + ;
                 chr( 10 ) + 'Program: ' + program() + chr( 13 ) + ;
                 chr( 10 ) + 'Line #: ' + ltrim( str( lineno() ) ) + ;
                 chr( 13 ) + chr( 10 ) + 'Line: ' + message( 1 ) + ;
                 chr( 13 ) + chr( 10 ) + 'Call Stack: ' + cCallStk( ',' ) )
    
    

  3. In the Command window, type:

    SET PROCEDURE TO etest DO estart x

You may receive the following error message when executing "DO estart" or when the "x" is entered into the command window:

    "Missing )"

Steps to Resolve Problem

  1. Rearrange the code as follows to avoid the error. Modify the code in ETEST.PRG to be:

    PROCEDURE ctest

         =vLog( 'FATAL', ;
    
               'FoxPro error #' + ltrim( str( error() ) ) + ;
                ': ' + message() + chr( 13 ) + chr( 10 ) + chr( 13 ) + ;
                chr( 10 ) + 'Program: ' + program() + chr( 13 ) + ;
                chr( 10 ) + 'Line #: ' + ltrim( str( lineno() ) ) + ;
                chr( 13 ) + chr( 10 ) + 'Line: ' + message( 1 ) + ;
                chr( 13 ) + chr( 10 ) + 'Call Stack: ' + cCallStk( ',' ) )
    
         WAIT WINDOW "done test"
    
       RETURN
    
       FUNCTION vlog
       PARAMETERS one,two
       RETURN ""
    
       FUNCTION ccallstk
       PARAMETERS one,two
       RETURN ""
    
    

  2. In the Command window, type:

    SET PROCEDURE TO etest ON ERROR =ctest() x


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


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.