[fpc-devel] Defining a constant record which contains an (dynamic or open) array

Joost van der Sluis joost at cnoc.nl
Tue Mar 2 09:14:48 CET 2010


Hi all,

I want to define a constant record, but the record contains an array. Is
that possible? I've tried the code below and it doesn't work. 

Compiler message: Fatal: Syntax error, "NIL" expected but "identifier
TESTATTRIBUTES" found on the last line.

type
  TAllowAttribute= record
                    AttributeName: string;
                    AllowContent: string; //regex
                  end;
  TAllowAttributes= array of TAllowAttribute;
  TAllowTag= record
              TagName: string;
              AllowContent: string; //regex
              AllowAttributes: array of TAllowAttribute;
            end;
  TAllowTags = array of TAllowTag;

const
  testattributes : array[0..0] of TAllowAttribute =
       ((attributename:'style'; allowcontent:'.*'));
  testtags : TAllowTag = 
       (tagname:'jojo'; allowcontent:'test'; AllowAttributes: testattributes);





More information about the fpc-devel mailing list