RXS_charToBln()
Use RXS_charToBln() to easily convert a character Boolean value (i.e. true/false, t/f, on/off/, 1/0) to an RPG Boolean. This will save the headache of programming for all of the different Boolean formats out there. Note that according to the XML specification that the valid Boolean values are true and false.
If the value in pValFrmXml matches the value in pTrueVal then *on will be returned. If the value in pValFrmXml matches the value in pFalseVal then *off will be returned. If the value in pValFrmXml doesn’t match either pTrueVal or pFalseVal then the value specified in pDftVal will be returned.
Typical usage would look like:
myBlnVar = RXS_charToBln(strBln: ‘true’: ‘false’: *off);
Subprocedure Prototype
|
Returns *On if the value being tested is considered true, *Off if it is considered false. |
|
Required The string value parsed from an XML document. Letters will be converted to lowercase before processing. Example: |
|
Required The value which, if passed in pValFrmXml, would represent a true Boolean condition. Must be lowercase. Example: |
|
Required The value which, if passed in pValFrmXml, would represent a false Boolean condition. Must be lowercase. Example: |
|
Required Default, fallback value which will be returned if the character data in pValFrmXml does not match either of the specified true or false values. |