Decode()

<< Click to Display Table of Contents >>

Navigation:  Available Functions >

Decode()

Syntax

Decode( <CodedField> )

 

Purpose

To translate the code from a coded field to the full description of the code during the printing of a report.

 

Parameters

<CodedField> is the name of a coded field in DonorQuest. This field can be any of the coded fields, such as donor type, title, state, country, donation type, donation account, donation stimulus, etc.

 

Returns

The full description of a code.

 

Usage

Decode() is normally used with the report writer to produce reports which print the full description for particular coded fields within DonorQuest.

 

Example

The following examples illustrate Decode():

 

CALL

RESULT

.Donor_Type.

I

Decode( .Donor_Type. )

Individual

 

 

.Donation_Type.

VC

Decode( .Donation_Type. )

Visa Card

 

 

.State.

CA

Decode( .State. )

California

 

In order for Decode() to work properly, you must have entered descriptions for all of the codes used by your organization. The entry of descriptions for new codes can be done at data entry time inside the data entry module. To add descriptions to existing codes, you must use the Codes Maintenance option of the System Information And Maintenance menu (see section eighteen).

 

If the Decode() function is asked to translate a code for which there is no description yet defined, Decode() will simply return the code it was given as the description. Because of this feature, you can use Decode() freely on all coded fields in reports without worrying about Decode() causing a blank space to print when there is no translation for a code.