On 25.12.2011 22:53, ik wrote:
2011/12/25 Jiří Pavlovský <j...@getnet.cz <mailto:j...@getnet.cz>>

    Hello,

    how can I create two level map where value is array of  records?
    These  records are constant - I don't need to compute them or
    anything.
    I'm quite new to pascal and for gods sake cannot figure it out. I
    tried to use TFPGMap for that.

    I mean somewhere in the code I get two values and based on these I
    need to get those records.

    my dream would be something like
    myArrayOfRecords := myMap[some_value][other_value];


type
   TMyRec = record
     Field   : integer;
     Empty,
    Check : Boolean;
   end;

 TMyMap = array[0..Something] of TMyRec;

Thanks, but that is not want I need.
I don't want array, but a two level map where keys are not necessarily integers.






    OTOH similar construct works in "const" section. So I'm quite puzzled.


What do you mean ?
I mean the code below works ok, so I don't undestand why it doesn't compile when I use similar construct inside a function.
const ranges: array [1..2] of TMyRec =
     (
         (Start:    0;    Stop:    3),
         (Start:    4;    Stop:    7)
       );

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to