System.SysUtils.BoolToStr

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function BoolToStr(B: Boolean; UseBoolStrs: Boolean = False): string;

C++

extern DELPHI_PACKAGE System::UnicodeString __fastcall BoolToStr(bool B, bool UseBoolStrs = false);

Properties

Type Visibility Source Unit Parent
function public
System.SysUtils.pas
System.SysUtils.hpp
System.SysUtils System.SysUtils

Description

Converts a Boolean value into a string.

BoolToStr converts the given Boolean value into a string as follows.



Value of B Value of UseBoolStrs Value of returned string

true

false

'-1'

true

true

The first string in TrueBoolStrs (default 'True');

false

false

'0'

false

true

The first string in FalseBoolStrs (default 'False');



Note: The TrueBoolStrs and FalseBoolStrs variables are undefined when an application starts. Any use of StrToBool, BoolToStr, or TryStrToBool will cause these variables to be initialised with the default values above.

See Also


Code Examples