Determine the position of the last actual parameter passed

     PCOUNT() --> nLastArgumentPos


     PCOUNT() returns, as an integer numeric value, the position of the last
     argument passed.  If no arguments are passed, PCOUNT() returns zero.


     PCOUNT() reports the position of the last argument in the list of
     arguments passed when a procedure or user-defined function is invoked.
     This information is useful when determining whether arguments were left
     off the end of the argument list.  Arguments skipped in the middle of
     the list are still included in the value returned.

     To determine if a parameter did not receive a value, test it for NIL.
     Skipped parameters are uninitialized and, therefore, return NIL when
     accessed.  Another method is to test parameters with the VALTYPE()
     function.  This can establish whether the argument was passed and
     enforce the correct type at the same time.  If a parameter was not
     supplied, a default value can be assigned.

     For more information on passing parameters, refer to the "Basic
     Concepts" chapter in the Programming and Utilities Guide.


     .  This example is a user-defined function that opens a database
        file and uses PCOUNT() to determine whether the calling procedure
        passed the name of the database file to be opened.  If the name was
        not passed, OpenFile() asks for the name:

        FUNCTION OpenFile( cFile )
           IF PCOUNT() = 0
              ACCEPT "File to use: " TO cFile
           USE (cFile)
           RETURN (NETERR())

 Files   Library is CLIPPER.LIB.



2 responses to “C5_PCOUNT

  1. Pingback: C5_PROCEDURE | Viva Clipper !

  2. Pingback: C5_FUNCTION | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.