Recent

Author Topic: Invalid variant operation  (Read 8804 times)

Raiden2

  • Guest
Invalid variant operation
« on: May 14, 2004, 06:56:12 am »
Hi again,

Code: [Select]

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;


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

Anonymous

  • Guest
Invalid variant operation
« Reply #1 on: May 14, 2004, 08:05:55 am »
I think i should say...: in kylix works... :?

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2614
Invalid variant operation
« Reply #2 on: May 18, 2004, 10:40:55 am »
Maybe it has a problem with the comma in 0,006010121
Does it say on which line the error is ?
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

Anonymous

  • Guest
Invalid variant operation
« Reply #3 on: May 18, 2004, 04:05:15 pm »
Quote from: "Marc"
Maybe it has a problem with the comma in 0,006010121
Does it say on which line the error is ?
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

  • Administrator
  • Hero Member
  • *
  • Posts: 2614
Invalid variant operation
« Reply #4 on: May 25, 2004, 12:03:38 pm »
This looks like some problem with FPC. What FPC version are you using (I assume your os is Linux)
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

 

TinyPortal © 2005-2018