Routines

The function SQR returns the square root in VB but the square in Pascal! In Pascal, the square root function is SQRT.

Pascal equivalents of the VB string functions given in parentheses are Length (Len), Pos (InStr), LeftStr (Left), MidStr (Mid), RightStr (Right), UpperCase (UCase) and LowerCase (LCase). See Basic String Routines for examples of their use.

Instead of ToString() and CInt(), you can use these Pascal conversion routines:

  • IntToStr, which converts integer to string;
  • FloatToStr, which converts real to string;
  • FloatToStrf, which converts real to formatted string;
  • DateTimeToStr, which converts from TDateTime to string;
  • StrToInt, which converts string to integer.
Programming - a skill for life!

Important differences between the code of Pascal and VB console programs