Link to home
Start Free TrialLog in
Avatar of lucat
lucat

asked on

Accessing a nested field...

Hello,
i'm using TClientDataSet to read the data from a XML file.
I have a nested field and i need to access to its "subfields"... how can i do that through code?
I tried to read the help, it says something about using the TDatasetField class but i can't figure out how.
Let's say that i have something like this:


procedure Test;
var
 CDS: TClientDataSet;
begin
 CDS := TClientDataSet.Create(Self);  
 CDS.LoadFromFile('myfile.xml');      
 CDS.Active := True;                            
 if CDS.RecordCount > 0 then              
 begin  
  CDS.First;                                          
  //here i should read the subfields
  //of a nested field (let's call it
  //'mynestedfield')... how can i do this?
 end;
 CDS.Active := False;
 CDS.Free;
end;



Any suggestion is welcome.

Bye,
   Luca T.
ASKER CERTIFIED SOLUTION
Avatar of nestorua
nestorua

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lucat
lucat

ASKER

Why is it unreasonable? I need it only to read from a XML file the translations of my menus and the settings when the program starts... then i don't need it anymore... why using comp memory and resources for something that i will not use anymore?

Anyway... can you show me an example?
Shouldn't be that field a persistent field to use it that way? How do i make a field become a persistent field through code to do it?

Thank you,
   Luca
HI, lucat,
Sure I can show you an example of what I said,
but first tell me what item of my proposal you can not realize?
I seemed to give you accurate plan what to do.
Sincerely,
Nestorua.
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept answer from nestorua

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Paul (pnh73)
EE Cleanup Volunteer