@@布尔型怎么转换成字符串型@@(简单吧~~ 可我就是不知道) 哈哈~(5分)

3

3333W

Unregistered / Unconfirmed
GUEST, unregistred user!
@@布尔型怎么转换成字符串型@@(简单吧~~ 可我就是不知道) 哈哈~
 
function BoolToStr(B: Boolean
UseBoolStrs: Boolean = False): string;
 
IntToStr(Integer(Boolean));
 
var
b: Boolean;
begin
b := True;
ShowMessage(IfThen(b, '真', '假'));
b := False;
ShowMessage(IfThen(b, '真', '假'));
end;
 
function BooleanToStr(aBoolean:Boolean):string;
begin
Result:='False';
if aBoolean then
Result:='True';
end;
 
function BooleanToStr(aBoolean:Boolean):string;
begin
Result:=ifThen(aBoolean,'True','False');
end;
 
综合一下。

TBSEnum = (bsEnglish, bsChinese, bsYN);

function btos(b: boolean
i: TBSEnum): string;
const
s: array[TBSEnum, boolean] of string[6] = (('False', 'True'), ('假', '真'), ('No', 'Yes'));
begin
result := s;
end;
 
function BoolToStr(B: Boolean
UseBoolStrs: Boolean = False): string;
帮助里有!
 
wind2000 已经给了正确的答案了
 
顶部