Board index » delphi » Const Array of Record

Const Array of Record

I am trying to use the following code to create a sort of data
dictionary for creating tables.  Unfortunately, I cannot figure out how
to enter the constant array of records.  Does anybody know how?  Please
e-mail me as well as post.  Thanks a bunch!

     type
        TTmstable = (tmsTCENTRY, tmsSCENTRY, tmsVSCENTRY,
     tmstable4);
        TTmstableInfo = record
           TableName : String;
           Structure : String;
           Index     : String;
        end;

     const
        TmstableInfo : Array[TTmstable] of TTmstableInfo =
           (('TCEntry.adt', 'TCID,         Char,      10;'+
                            'SCID,         Char,      10;'+
                            'VSCID,        Char,      10;'+
                            'System,       Char,       4;'+
                            'FunctionCode, Char,      10;'+
                            'Fun_Text,     Char,      30;'+
                            'Sys_Text,     Char,      30;',   ''),

           ('SCEntry.adt', 'TCID,         Char,       10;'+
                            'SCID,         Char,       3;'+
                            'VSCID,        Char,       3;'+
                            'System,       Char,       4;'+
                            'FunctionCode, Char,      10;'+
                            'Fun_Text,     Char,      30;'+
                            'Sys_Text,     Char,      30;',   ''),

           ('VSCEntry.adt', 'TCID,         Char,      10;'+
                            'SCID,         Char,       3;'+
                            'VSCID,        Char,       3;'+
                            'System,       Char,       4;'+
                            'FunctionCode, Char,      10;'+
                            'Fun_Text,     Char,      30;'+
                            'Sys_Text,     Char,      30;',   ''),

           ('Answer.adt',   'System,       Char,       4;'+
                            'FunctionCode, Char,      10;'+
                            'TotalTCID,    Integer;'+
                            'TCIDScripted, Integer;'+
                            'TCIDNot,      Integer;'+
                            'TotalSCID,    Integer;'+
                            'Sys_Text,     Char,      30;'+
                            'Fun_Text,     Char,      30;',
     'System')
           );

 

Re:Const Array of Record


Quote
In article <389F8D04.81979...@TestmastersInc.com>, Ralph Quarles wrote:
> I am trying to use the following code to create a sort of data
> dictionary for creating tables.  Unfortunately, I cannot figure out how
> to enter the constant array of records.  Does anybody know how?  Please
> e-mail me as well as post.  Thanks a bunch!

Check the entry "record constants" in the online help. YOu have to name
the fields in your constants:

Quote
>      const
>         TmstableInfo : Array[TTmstable] of TTmstableInfo =
>            ((TableName: 'TCEntry.adt';

               Structure: 'TCID,         Char,      10;'+
Quote
>                             'SCID,         Char,      10;'+
>                             'VSCID,        Char,      10;'+
>                             'System,       Char,       4;'+
>                             'FunctionCode, Char,      10;'+
>                             'Fun_Text,     Char,      30;'+
>                             'Sys_Text,     Char,      30;';

               Index:''),

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!

Sent using Virtual Access 5.00 - download your freeware copy now
http://www.atlantic-coast.com/downloads/vasetup.exe

Re:Const Array of Record


Thank you so much for your help.  I looked under "records", "arrays", "record
arrays" and others  in the help files and couldn't find anything that would
give me a clue at how to do this.  Thank you very much.

Ralph

Quote
"Peter Below (TeamB)" wrote:
> In article <389F8D04.81979...@TestmastersInc.com>, Ralph Quarles wrote:
> > I am trying to use the following code to create a sort of data
> > dictionary for creating tables.  Unfortunately, I cannot figure out how
> > to enter the constant array of records.  Does anybody know how?  Please
> > e-mail me as well as post.  Thanks a bunch!

> Check the entry "record constants" in the online help. YOu have to name
> the fields in your constants:

> >      const
> >         TmstableInfo : Array[TTmstable] of TTmstableInfo =
> >            ((TableName: 'TCEntry.adt';
>                Structure: 'TCID,         Char,      10;'+
> >                             'SCID,         Char,      10;'+
> >                             'VSCID,        Char,      10;'+
> >                             'System,       Char,       4;'+
> >                             'FunctionCode, Char,      10;'+
> >                             'Fun_Text,     Char,      30;'+
> >                             'Sys_Text,     Char,      30;';
>                Index:''),

> Peter Below (TeamB)  100113.1...@compuserve.com)
> No e-mail responses, please, unless explicitly requested!

> Sent using Virtual Access 5.00 - download your freeware copy now
> http://www.atlantic-coast.com/downloads/vasetup.exe

Other Threads