Собственно интересует, как корректно организовать работу функции TryStrToBool
в Delphi 5?
1 ответ
А где то так
function TryStrToBool(s:string; default:boolean):boolean;
begin
s := trim(s);
if sametext(s, 'true') then result := true
else if sametext(s, 'false') then result := false
else result := default;
end;