Janilabo

erm

Sep 25th, 2013
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.63 KB | None | 0 0
  1. function BoolToInt(bool: Boolean): Integer;
  2. begin
  3.   if bool then
  4.     Result := 1
  5.   else
  6.     Result := 0;
  7. end;
  8.  
  9. function BoolToInt2(bool: Boolean): Integer;
  10. begin
  11.   Result := 0;
  12.   if bool then
  13.     Result := 1;
  14. end;
  15.  
  16. function BoolToInt3(bool: Boolean): Integer;
  17. begin
  18.   if bool then
  19.     Result := 1;
  20. end;
  21.  
  22. var
  23.   test: Integer;
  24.  
  25. begin
  26.   ClearDebug;
  27.   test := 99;
  28.   test := BoolToInt(False);
  29.   WriteLn('BoolToInt: ' + IntToStr(test));
  30.   test := 99;
  31.   test := BoolToInt2(False);
  32.   WriteLn('BoolToInt2: ' + IntToStr(test));
  33.   test := 99;
  34.   test := BoolToInt3(False);
  35.   WriteLn('BoolToInt3: ' + IntToStr(test));
  36. end.
Advertisement
Add Comment
Please, Sign In to add comment