Hi,
how can I get the following piece of code to work:
type MenuRec=RECORD
word_menuItem:word;
word_itemNumber:word;
p_itemArray:array[1..word_itemNumber]of pchar; {<- error occurs
here! }
END;
I guess, you will understand what I want to do: I'd like to use a value
stored in word_itemNumber for defining the size of an array within the
very same Record.
But it won't compile, I get the following error message:
Free Pascal Compiler version 2.1.1 [2007/01/05] for i386
Copyright (c) 1993-2006 by Florian Klaempfl
Target OS: Darwin for i386
Compiling testprog.pas
dataworx.pas(23,45) Error: Identifier not found "word_itemNumber"
dataworx.pas(23,45) Error: Can't evaluate constant expression
dataworx.pas(23,54) Error: Data element too large
dataworx.pas(239,4) Fatal: There were 3 errors compiling module, stopping
Fatal: Compilation aborted
Error: /usr/local/bin/ppc386 returned an error exitcode (normal if you
did not specify a source file to be compiled)
How to solve this problem?
Thanks in advance,
Dennis Schramm


|