GetReturnCode
汇总
返回地理处理消息的消息错误代码。
如果指定索引的消息是警告或信息性消息,函数将返回 0;如果消息是错误,函数将返回 0 以外的值。
语法
GetReturnCode(index)
| 参数 | 说明 | 数据类型 |
|---|---|---|
|
index |
The specified position of the message in the returned list of messages, warnings, or errors. |
Integer |
返回值
| 数据类型 | 说明 |
|---|---|
|
Integer |
指定索引位置的消息的返回代码。 |
代码示例
GetReturnCode 示例
返回指定消息的严重性代码。
import arcpy
arcpy.env.workspace = "c:/census/data.gdb"
arcpy.analysis.Erase("housing", "income", "low_income")
# Return the return code of the message in index
# position 3 (4th message)
print(arcpy.GetReturnCode(3))