Cicode Programming Reference > Cicode Function Categories > Quality Functions Introduction > QualityToStr

QualityToStr

Returns a textual representation of the quality.

Syntax

QualityToStr(QUALITY quality, INT part, INT localized)

quality:

Specifies the QUALITY variable.

part:

Specifies the part of quality to obtain the textual representation.

-2: Short representation in the format <General Quality> [– <Quality Substatus>]

-1: Full representation in the format <General Quality> [Override] [Control Inhibit] – <Quality Substatus>

0: <General Quality>

1: <Quality Substatus>

2: <Quality Limit>

3: <Extended Quality Substatus>

4: <Quality Override>

5: <Control Inhibit>

localized:  

The flag indicating if the returned text should be in native language or in Runtime localized language.

Return Value

A textual representation of the quality, or an empty string if the part given is not applicable.

Related Functions

QualityGetPart, QualityIsBad, QualityIsContolInhibit, QualityIsGood, QualityIsOverride, QualityIsUncertain, QualitySetPart, QualityCreate

Example

QUALITY q;;
STRING str;
q = QualityCreate(QUAL_GOOD, 0, QUAL_LIMITED_NOT_LIMITED,
QUAL_EXT_NON_SPECIFIC, 1, 1, 0);
str = QualityToStr(q, -1, 0);
// The result is: Good [Override] [Control Inhibit]
 
q = QualityCreate(QUAL_GOOD, QUAL_GOOD_LOCAL_OVERRIDE,
QUAL_LIMITED_NOT_LIMITED, QUAL_EXT_NON_SPECIFIC);
str = QualityToStr(q, 1, 0);
// The result is: Overriden
 
q = QualityCreate(QUAL_GOOD, 0, QUAL_LIMITED_QL_LOW_LIMITED,
QUAL_EXT_NON_SPECIFIC);
str = QualityToStr(q, 2, 0);
// The result is: Below Low
 
SetLanguage(“FRENCH”);
 
q = QualityCreate(QUAL_GOOD, 0, QUAL_LIMITED_NOT_LIMITED,
QUAL_EXT_NON_SPECIFIC, 1, 1, 0);
str = QualityToStr(q, -1, 1);
// The result is: Bon [Supplémenté] [Contrôle Inhibé]
// Entries for ‘Bon’, ‘Supplémenté’ and ‘Contrôle Inhibé’
// needs to have been provided in FRENCH.dbf
 
SetLanguage(“ENGLISH”);
 
q = QualityCreate(QUAL_BAD, QUAL_BAD_CONFIGURATION_ERROR,
QUAL_LIMITED_NOT_LIMITED, QUAL_EXT_NON_SPECIFIC);
str = QualityToStr(q, -1, 0);
// The result is: Bad - Configuration Error
 
SetLanguage(“FRENCH”);
 
q = QualityCreate(QUAL_BAD, QUAL_BAD_CONFIGURATION_ERROR,
QUAL_LIMITED_NOT_LIMITED, QUAL_EXT_NON_SPECIFIC);
str = QualityToStr(q, -1, 1);
// The result is: Mauvais - Erreur de Configuration
 
SetLanguage(“ENGLISH”);
 
q = QualityCreate(QUAL_UNCR, QUAL_UNCR_NON_SPECIFIC,
QUAL_LIMITED_NOT_LIMITED, QUAL_EXT_TAG_OUT_OF_RANGE);
str = QualityToStr(q, 0, 0);
// The result is: Uncertain
 
q = QualityCreate(QUAL_UNCR, QUAL_UNCR_NON_SPECIFIC,
QUAL_LIMITED_NOT_LIMITED, QUAL_EXT_TAG_OUT_OF_RANGE);
str = QualityToStr(q, 3, 0);
// The result is: Tag Address Out Of Range
 
q = QualityCreate(QUAL_UNCR, QUAL_UNCR_SUBNORMAL,
QUAL_LIMITED_NOT_LIMITED, QUAL_EXT_NON_SPECIFIC);
str = QualityToStr(q, 1, 0);
// The result is: Subnormal

See Also

Quality Functions