New account

Another variant problem  Bottom

  • Comparing an variant with an integer variable results in an "Internal Compiler error".

    Example :

    Code

    var

    v : variant;

    i : longint;



    Begin

    v := 1;

    i := 2;

    if v = i then // Internal compiler error

    i := 0;

    End;


    Comparing with a string or a constant value does not fail !

    Example :

    Code

    var

    v : variant;

    i : longint;

    s : string;



    Begin

    v := '1';

    s := '2';

    if v = s then // No error

    s := '';



    v := 1;

    i := 2;

    if v = 1 then // No error

    i := 0;

    End;


    Kim Foder
  • 0 users

This list is based on users active over the last 30 minutes.