You can use the case identifier inside records.
That way you can access different ways of looking at it
I can't recommend strongly enough though if you use case - store which case was used ...
I always think it is good to use Packed records for this - especially it the record is going to be used by anything else...
 
 
 
 
 
Regards
Paul McKenzie
Analyst Programmer
SMSS Ltd.
----- Original Message -----
Sent: Monday, October 14, 2002 11:13 AM
Subject: RE: [DUG]: Load different types from one procedure?

I don't like the sound of using the path as an indicator of how the data is to be interpreted. A better solution would be to pass in a third parameter which defines the way the data is to be interpreted, i.e., the record to use.
 
By the way, depending on how much control you have over the data, I would really try to do away with one of the records, since. after all, they describe the same same information, just in a different order. Is this really necessary?
 
 
-Andreas
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jason Coley
Sent: Monday, 14 October 2002 10:29
To: Multiple recipients of list delphi
Subject: [DUG]: Load different types from one procedure?

Is there a way I can load different record type objects using one procedure?

 

I have

 

TType1 = record

            intone: integer;

            strone: array[1..49] of char;

end;

 

TType2 = record

            strtwo: array[1..49] of char;

            Inttwo: integer;

end;

 

These types are stored as files on my system, but I want to have one procedure/function that can load either type by simply passing the path, can you do this.

 

I have something like

 

Procedure LoadTemplate(Path: String; var Data: array of char);

 

But this doesn’t work as the type and array are not compatible.

 

I think this could be a Monday morning thing, but I have had two coffee’s!!!!

 

Jason

Reply via email to