GetReturnCode

摘要

通过索引返回消息错误代码。

如果指定索引的消息是警告或信息性消息,函数将返回 0;如果消息是错误,函数将返回 0 以外的值。

语法

GetReturnCode (index)
参数说明数据类型
index

消息、警告或错误返回列表中消息的指定位置。

Integer
返回值
数据类型说明
Integer

指定索引位置的消息的返回代码。

代码示例

GetReturnCode 示例

返回指定消息的严重性代码。

import arcpy
arcpy.env.workspace = "c:/census/data.gdb"
arcpy.Erase_analysis("housing", "income", "low_income")
# Return the return code of the message in index
# position 3 (4th message)
print(arcpy.GetReturnCode(3))

相关主题