Skip to content

ToInteger does not work with Copy.

System Information

Lazarus 2.2.0 (rev lazarus_2_2_0) FPC 3.2.2 x86_64-win64-win32/win64

Steps to reproduce

var
  intX: Integer;
  strS: String;
begin
    // This works.
    intX := StrToInt(Copy('12345', 1, 3));

    // This works.
    strS := Copy('12345', 1, 3);
    intX := strS.ToInteger;

    // There is an error message here (Error: Illegal qualifier).
    intX := Copy('12345', 1, 3).ToInteger;
    .
    .
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information