Forum > General

Invalid variant operation

(1/1)

Raiden2:
Hi again,


--- Code: ---
var
valor:variant;

begin

valor:=edit1.text;

case combobox1.itemindex of
     0:begin
            case combobox2.itemindex of
            0:begin
                   application.messagebox('Inserta monedas distintas','Error',0);
            end;
            1:begin
                  edit2.Text:=valor*166.386;
            end;
            end;
     end;
     1:begin
            case combobox2.itemindex of
            0:begin
                   valor:=edit2.text;
                   edit1.text:=valor*0,006010121;
            end;
            1:begin
                   application.messagebox('Inserta monedas distintas','Error',0);
            end;
            end;
     end;
     end;

--- End code ---


After execute that (in a button), the program says me "Invalid variant operation", do you know why?

Anonymous:
I think i should say...: in kylix works... :?

Marc:
Maybe it has a problem with the comma in 0,006010121
Does it say on which line the error is ?

Anonymous:

--- Quote from: "Marc" ---Maybe it has a problem with the comma in 0,006010121
Does it say on which line the error is ?
--- End quote ---
No, the comma in 0,0060121 isn't the problem (is a mistake when I copied it here the number). The line where Lazarus says me "Invalid variant operation" is the forth one "valor:=edit1.text;"

Marc:
This looks like some problem with FPC. What FPC version are you using (I assume your os is Linux)

Navigation

[0] Message Index

Go to full version