[fpc-pascal] How to init Array values in a record?
yu ping
spingyu at gmail.com
Thu Feb 4 17:32:46 CET 2010
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
The org defination is:
_TBBUTTON = Record
iBitmap : cint;
idCommand : cint;
fsState : BYTE;
fsStyle : BYTE;
{$IFDEF _WIN64}
bReserved : ARRAY[0..5] OF BYTE;
// padding for alignment
{$ELSE}
{$IFDEF _WIN32}
bReserved : ARRAY[0..1] OF BYTE;
// padding for alignment
{$ENDIF}
{$ENDIF}
dwData : DWORD_PTR;
iString : INT_PTR;
END;
TBBUTTON = _TBBUTTON;
2010/2/5 Anthony Walter <sysrpl at gmail.com>
> Like so:
>
> (iBitmap:0; idCommand: 0; fsState:0; fsStyle:0; bReserved: (0,0);
> dwData: nil; iString: nil)
> _______________________________________________
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
--
http://pingyu.wordpress.com.cn
http://step7.blog.163.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20100205/e4ffbd99/attachment.html>
More information about the fpc-pascal
mailing list