[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'System' (#rtl)

OctStr

Convert integer to a string with octal representation.

Declaration

Source position: line 0

function OctStr(

  Val: LongInt;

  cnt: Byte

):shortstring;

function OctStr(

  Val: Int64;

  cnt: Byte

):shortstring;

function OctStr(

  Val: qword;

  cnt: Byte

):shortstring;

Description

OctStr returns a string with the octal representation of Value. The string has exactly cnt charaters.

Errors

None.

See also

Str

  

Convert a numerical value to a string.

Val

  

Calculate numerical/enumerated value of a string.

BinStr

  

Convert integer to string with binary representation.

HexStr

  

Convert integer value to string with hexadecimal representation.

Example

Program example112;

{ Program to demonstrate the OctStr function }

Const Value = 45678;

Var I : longint;

begin
  For I:=1 to 10 do
    Writeln (OctStr(Value,I));
  For I:=1 to 16 do
    Writeln (OctStr(I,3));
end.
The latest version of this document can be found at lazarus-ccr.sourceforge.net.