Description

Converts characters or words into internal values of true (1) or false (0).

Syntax

internal = IConv (string, "B [ tf ] ")

- OR -

internal = IConv (string, "B [ true, false ]")

Parameters

IConv Boolean (B) accepts arguments for the following parameters.

ParameterDescription
stringContains a character or word that represents a Boolean condition. Examples of characters include "Y" and "N" or "T" and "F". Examples of words are "Yes" and "No" or "True" and "False." Any characters or words can be used in string. If string cannot be converted into a Boolean value, Status() returns a 1.
BIndicates a Boolean conversion. If no additional options are provided, the conversion examines the default Boolean conversion in the currently active language/national data set, and uses the first letter of the true string and the first letter of the false string found there. In the default language/national data set, "B" is interpreted the same as "BYes,No".

- or -

ParameterDescription
BXBX is used for international default conversions. Requires that a language is set in the environment, in field 15 (@environ.set<ENV_LND_DEFAULT$> ), eg LND_GERMAN_D, LND_FRENCH_F, etc., etc., etc. The language needs to be set within the SYSENV record prior to start.
TfWhen the tf option is used, the conversion matches the first character of string against the characters represented by t and f, without regard to case. If the first character of string matches t, the function returns a Boolean true (1). If the first character matches f, a Boolean false (0) is returned. If string is null, a null is returned.
true,falseIf the true,false option is used, the conversion matches string against the words represented by true and false. If string matches true, a Boolean true is returned. If string matches false, a Boolean false is returned. For each lowercase alphabetic character in true,false, the comparison is done without regard to case. For all other characters (upper case alphabetic or numeric), the comparison is done exactly.

Example

* Converting to internal Boolean format
VALUE = "T"
TEST = IConv(VALUE, "BTF")
* TEST is set to 1 (one).
/* if the Language is set to French the value of this will be 1 */
value = "Oui"
this = Oconv(value, 'BX')
  • No labels