[fpc-pascal] Typed constant

Valdas Jankūnas zmuogs at gmail.com
Fri Oct 24 21:51:05 CEST 2008


Hello,

code snippet from my app:

type
   TLaikoJuosta=record
       Valanda, Minute: SmallInt;
   end;

const
   MAX_LAIKO_JUOSTA: TLaikoJuosta=(Valanda: 99; Minute: 59);

  I want create another constant:

MAX_LAIKO_JUOSTA_MINUTEMIS=MAX_LAIKO_JUOSTA.Valanda*MinsPerHour+MAX_LAIKO_JUOSTA.Minute;

  But compiler (I working in Lazarus v0.9.27 r16994 i386-linux-gtk 2 
(beta); fpc 2.2.2) reported "Error: Illegal expression" and cursor 
blinks at end of line of new constant. Same error if I try:

MAX_LAIKO_JUOSTA_MINUTEMIS: 
SmallInt=MAX_LAIKO_JUOSTA.Valanda*MinsPerHour+MAX_LAIKO_JUOSTA.Minute;

  I creating constant from a constant. But why I getting that error?


-- 
   Valdas Jankūnas



More information about the fpc-pascal mailing list