<b>string_to_boolean()</b>




Document: The safe-c User Guide

next boolean_to_string()
up Functions
gif integer_to_string()

string_to_boolean()

string_to_boolean() accepts exactly one argument, which must be of string_type. This may be a variable or a constant. However, in practise, it is normally a variable (since, otherwise, a constant of boolean_type could simply be used directly, instead of invoking string_to_boolean() to process a string constant). In any case, if the argument is a variable, it will not be altered by string_to_double.

string_to_boolean() produces a return value of boolean_type.

string_to_boolean examines the string given as an argument, and interprets it (if possible) as a string representation of a boolean value. That is, the string must have the value "TRUE" or "FALSE" - except that leading or trailing whitespace will be ignored. Providing that the string can be interpreted successfully in this way, string_to_boolean() will produce the internal binary representation (i.e. of boolean_type) of this value as the return value. If the string cannot be interpreted in this way (e.g. "rhubarb" or "True" or "wrong" etc.) then a runtime exception will be generated and the program will terminate abnormally.




Document: The safe-c User Guide

next boolean_to_string()
up Functions
gif integer_to_string()



McMullin@eeng.dcu.ie
Fri Jan 12 12:30:02 GMT 1996