ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

GetReturnCode

  • Summary
  • Syntax
  • Code sample

Summary

Return the message error code by index.

If the message for the specified index is a warning or informative message the function will return a 0; if the message is an error the function will return a value other than 0.

Syntax

GetReturnCode (index)
ParameterExplanationData Type
index

The specified position of the message in the returned list of messages, warnings, or errors.

Integer

Return Value

Data TypeExplanation
Integer

The return code of the message at the specified index position.

Code sample

GetReturnCode example

Returns the severity code for the specified message.

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))

Related topics

  • AddError
  • AddIDMessage
  • AddMessage
  • AddReturnMessage
  • AddWarning
  • GetMessage
  • GetMessageCount
  • GetMessages
  • Writing messages in script tools
  • Understanding message types and severity
  • Understanding messages in script tools

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2019 Esri. | Privacy | Legal