ParameterCount property |
|
|
Release 9.3
Last modified January 19, 2010 |
Print all topics in : "Properties and Methods" |
Note:
This topic was updated for 9.3.1.
Returns the number of parameters
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