| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 2.11

 

conv_bool_str

#include "sflconv.h"
char *
conv_bool_str (
    Bool boolean,
    int  format)

Synopsis

Converts a Bool value to a string according to the specified format: 0 = Yes|No; 1 = Y|N, 2 = True|False, 3 = T|F, 4 = 1|0. Returns a pointer to a static string that is overwritten by each call.

Source Code - (sflcvbs.c)

{
    static char *bool_name [] =
      {
        "Yes",  "No",
        "Y",    "N",
        "True", "False",
        "T",    "F",
        "1",    "0"
      };

    conv_reason = 0;                    /*  No conversion errors so far      */
    return (bool_name [format * 2 + (boolean? 0: 1)]);
}

| << | < | > | >> iMatix Copyright © 1996-2000 iMatix Corporation