Results 1 to 3 of 3

Thread: help needed : Typed CONSTANTs

  1. #1

    Post help needed : Typed CONSTANTs

    My question is, how can i set up a constant of a special type with several values ?

    <code>
    TYPE
    TDesc = record
    a,b,c : dword;
    end;

    // typed constant declaration identifier : type = typed constant
    CONST
    abc : TDesc = ( a:dword=10
    b:dword=11,
    c:dword=12 );
    </code>

  2. #2
    PGD Community Manager AthenaOfDelphi's Avatar
    Join Date
    Dec 2004
    Location
    South Wales, UK
    Posts
    1,169
    Blog Entries
    2
    Do something like this:-

    Code:
    Type
      TMyType = record
        name: string;
        data1: integer;
        data2: string;
      end;
    
    Const
      MY_DATA : array[0..1] of TMyType = (
        (name:'Fred'; data1:10; data2:'Favourite colour'),
        (name:'Borris';  data1:16; data2:'Mother''s maiden name')
      );
    :: AthenaOfDelphi :: My Blog :: My Software ::

  3. #3

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •