Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function BoolToInt(bool: Boolean): Integer;
- begin
- if bool then
- Result := 1
- else
- Result := 0;
- end;
- function BoolToInt2(bool: Boolean): Integer;
- begin
- Result := 0;
- if bool then
- Result := 1;
- end;
- function BoolToInt3(bool: Boolean): Integer;
- begin
- if bool then
- Result := 1;
- end;
- var
- test: Integer;
- begin
- ClearDebug;
- test := 99;
- test := BoolToInt(False);
- WriteLn('BoolToInt: ' + IntToStr(test));
- test := 99;
- test := BoolToInt2(False);
- WriteLn('BoolToInt2: ' + IntToStr(test));
- test := 99;
- test := BoolToInt3(False);
- WriteLn('BoolToInt3: ' + IntToStr(test));
- end.
Advertisement
Add Comment
Please, Sign In to add comment