fpc-pascal  

Re: [fpc-pascal] How to init Array values in a record?

Jonas Maebe
Thu, 04 Feb 2010 08:55:39 -0800

On 04 Feb 2010, at 17:32, yu ping wrote:

> I use :
>   tbrbtns:array[0..5] of TBBUTTON =(
> 
> (iBitmap:7;idCommand:10000;fsState:TBSTATE_ENABLED;fsStyle:TBSTYLE_BUTTON;dwData:0;iString:0),
> 
> (iBitmap:8;idCommand:10001;fsState:TBSTATE_ENABLED;fsStyle:TBSTYLE_BUTTON;dwData:0;iString:0),
> 
> (iBitmap:0;idCommand:0;fsState:TBSTATE_ENABLED;fsStyle:TBSTYLE_SEP;dwData:0;iString:0),
> 
> (iBitmap:0;idCommand:10002;fsState:TBSTATE_ENABLED;fsStyle:TBSTYLE_BUTTON;dwData:0;iString:0),
> 
> (iBitmap:1;idCommand:10003;fsState:TBSTATE_ENABLED;fsStyle:TBSTYLE_BUTTON;dwData:0;iString:0),
> 
> (iBitmap:2;idCommand:10004;fsState:TBSTATE_ENABLED;fsStyle:TBSTYLE_BUTTON;dwData:0;iString:0)
> );
> compile success,I don't know why

Probably because you are using Delphi mode. Delphi allows skipping record 
fields in typed constant declarations, so FPC in Delphi mode also allows this. 
FPC will still give a warning in this case though. In other syntax modes, you 
get an error if you skip fields.


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