![]() |
|
#1
|
|||
|
|||
|
I can't get this correct and I'm not sure where to look.
Code:
for i:=1 to 6 do begin
'sCat'+IntToStr(i):=tDataSet(FindComponent('dm.tblRaceBIKECAT'+IntToStr(i)).asString;
end;
|
|
#2
|
|||
|
|||
|
without compiling I think your problem is here
tDataSet(dm.FindComponent('tblRaceBIKECAT'+IntToSt r(i)).asString; But also, you are assigning it to what exactly? 'sCat'+IntToStr(i) is not a VAR so not sure how this is suppose to work. Tell us what you are trying to do rather that posting snippits of code :-) Regards Donovan |
|
#3
|
|||
|
|||
|
Code:
FindComponent('dm.tblRaceBIKECAT'+IntToStr(i))
Code:
dm.FindComponent('tblRaceBIKECAT'+IntToStr(i))
Last edited by Norrit; 07-26-2012 at 07:46 AM. Reason: Read Donovan, he explained the other problem aswell |
|
#4
|
|||
|
|||
|
You are correct, I'm not sure what I was doing. I had a brain freeze, my app is very complex with a lot of linking between many tables and my concentration was diverted.
All I doing is reading values into variables. Code:
procedure TfRaceManual.Button3Click(Sender: TObject);
var
sCat1,sCat2,sCat3,sCat4,sCat5,sCat6:String;
i:integer;
begin
for i:=1 to 6 do begin
'sCat'+IntToStr(i):=dm.tblRace.FieldByName('BIKECAT'+IntToStr(i)).asString;
end;;
Code:
procedure TfRaceManual.Button3Click(Sender: TObject);
var
sCat:Array[1..6] of String;
i:integer;
begin
for i:=1 to 6 do begin
sCat[i]:=dm.tblRace.fieldByName('BIKECAT'+IntToStr(i)).asString;
end;
|
|
#5
|
|||
|
|||
|
I might as well add the next bit now
I have 20 database edit boxes on the screen with values, they are dbePoints1 ... dbePoints20 I need to transfer the value in the edit box into my table RaceResults, depending on the value of i something like dm.tblRaceResultsPOINTS.AsString:=tdbEdit(FindComp onent('dbePoints'+IntToStr(i))).text; |
![]() |
| Thread Tools | |
| Display Modes | |
|
|