Show Navigation | Hide Navigation
You are here:
Geoprocessing > Automating your work with scripts > Scripting object: Properties and Methods > Properties and Methods

ParameterCount property

Release 9.3
Last modified January 19, 2010
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Properties and Methods"


Related Topics

Note: This topic was updated for 9.3.1.

Returns the number of parameters

property symbol


Syntax


variable = object.ParameterCount

Return Value


Long

Examples



import arcgisscripting 
gp = arcgisscripting.create(9.3)

gp.OverWriteOutput = 1

try:
    # ParameterCount can be used to check that the correct number of
    #   parameters have been entered. If less than 2 have been specified
    #   raise an error.
    #
    if gp.ParameterCount < 2:
        raise "ParameterError"
    else:
        inputFC = gp.GetParameterAsText(0)
        outputFC = gp.GetParameterAsText(1)
        gp.CopyFeatures(inputFC, outputFC)

except "ParameterError":
    # Return an error message
    #
    errMessage = "2 parameters are required, only " + str(gp.ParameterCount) + " specified." 
    gp.adderror(errMessage)
    print errMessage




Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.