Is not valid value
Publicado por Joan Carles (9 intervenciones) el 18/03/2013 11:53:04
Buenos días,
Estoy realizando una pequeña aplicación con una serie de radio button los cuales tienen un valor númerico i el resultado sale reflejado en un text, el codigo que utilizo es el siguiente:
Y cada vez que escojo un radio button me sale el siguiente mensaje: '''' is not valid integer value, en cambio me realiza la suma bien y el resultado aparece en el text, alguién se le ocurre que es lo que esta fallando.
Gracias.
Estoy realizando una pequeña aplicación con una serie de radio button los cuales tienen un valor númerico i el resultado sale reflejado en un text, el codigo que utilizo es el siguiente:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
unit eqt;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Imaging.jpeg, Vcl.ExtCtrls,
Vcl.StdCtrls, Vcl.DBCtrls, Vcl.Mask;
type
TForm12 = class(TForm)
Label2: TLabel;
logo: TImage;
Label7: TLabel;
DBRadioGroup1: TDBRadioGroup;
DBRadioGroup2: TDBRadioGroup;
DBRadioGroup3: TDBRadioGroup;
DBRadioGroup4: TDBRadioGroup;
DBRadioGroup5: TDBRadioGroup;
DBRadioGroup6: TDBRadioGroup;
DBRadioGroup7: TDBRadioGroup;
DBRadioGroup8: TDBRadioGroup;
DBRadioGroup9: TDBRadioGroup;
Label1: TLabel;
DBEdit1: TDBEdit;
Button1: TButton;
Button2: TButton;
procedure Button2Click(Sender: TObject);
procedure DBRadioGroup1Change(Sender: TObject);
procedure DBRadioGroup2Change(Sender: TObject);
procedure DBRadioGroup3Change(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form12: TForm12;
implementation
{$R *.dfm}
procedure TForm12.Button2Click(Sender: TObject);
begin
Close;
end;
procedure TForm12.DBRadioGroup1Change(Sender: TObject);
begin
//showmessage(form12.DBRadioGroup1.Value);
//showmessage(form12.DBRadioGroup2.Value);
//form12.DBEdit1.Text := string(form12.DBRadioGroup1.Value) + string(form12.DBRadioGroup2.Value);
//form12.DBEdit1.Text := IntToStr(TryStrToInt(form12.DBRadioGroup1.Value)+ StrToInt(form12.DBRadioGroup2.Value)+ StrToInt(form12.DBRadioGroup3.Value) + StrToInt(form12.DBRadioGroup4.Value) + StrToInt(form12.DBRadioGroup5.Value) + StrToInt(form12.DBRadioGroup6.Value) + StrToInt(form12.DBRadioGroup7.Value)+ StrToInt(form12.DBRadioGroup8.Value)+ StrToInt(form12.DBRadioGroup9.Value));
form12.DBEdit1.Text := IntToStr(StrToInt(form12.DBRadioGroup1.Value) + StrToInt(form12.DBRadioGroup2.Value) + StrToInt(form12.DBRadioGroup3.Value));
end;
procedure TForm12.DBRadioGroup2Change(Sender: TObject);
begin
form12.DBEdit1.Text := IntToStr(StrToInt(form12.DBRadioGroup2.Value)+ StrToInt(form12.DBRadioGroup1.Value)+ StrToInt(form12.DBRadioGroup3.Value));
end;
procedure TForm12.DBRadioGroup3Change(Sender: TObject);
begin
form12.DBEdit1.Text := IntToStr(StrToInt(form12.DBRadioGroup3.Value)+ StrToInt(form12.DBRadioGroup1.Value)+ StrToInt(form12.DBRadioGroup2.Value));
end;
end.
Y cada vez que escojo un radio button me sale el siguiente mensaje: '''' is not valid integer value, en cambio me realiza la suma bien y el resultado aparece en el text, alguién se le ocurre que es lo que esta fallando.
Gracias.
Valora esta pregunta


0