Structure alignment

The docs say to right-click on a structure in the code editor to get a popup menu that has an “attributes” item to change the structure alignment, but I can’f seem to get to that.

Ah the LR needs an update there :slight_smile:
Open the Inspector (the panel on the right hand side of the UI)
Click the gear icon at the top and there’s the attributes

Aha. Thanks.
Now I can enter the alignment attributes, but it doesn’t seem to have any effect. 1,2,4,8,16,32 all show the same value for the first record in the structure. 1078071040. the actual value should be an integer from 0 to 150
This file was created by a program written in Delphi 3 in Windows. It is a typed file of a packed record. I have no idea what offset that provided. I would expect to get different results when changing the alignment attribute, though.

I’d expect 1 to be correct as thats about what “packed” means - use just the bytes as they are defined and no padding to align fields to X byte boundaries etc

http://www.realsoftwareblog.com/2012/02/structure-alignment.html

Ok. I’ll have to play around with this and see what works. Is it possible to just specify the space a structure field takes in bytes, rather than specifying a data type (Int32, String *15). Delphi has a data type TPoint that Xojo doesn’t have. It takes 8 bytes.

First define another structure called TPoint (or Point) and use this as the data type in your structure containing a TPoint.

right. Thanks