Page 1 of 1

AlignC as a keyword

Posted: Sun Jan 07, 2024 3:38 am
by idle
Could you add AlignC as a keyword, I spent an hours padding structures because I forgot about the flag #PB_Structure_AlignC

Re: AlignC as a keyword

Posted: Sun Jan 07, 2024 10:02 am
by Fred
I fail to see how it would have help you if you have forget about such functionality :P . Or may be to rework the help syntax here https://www.purebasic.com/documentation ... tures.html

Code: Select all

Structure <name> [Extends <name>] [Align <numeric constant expression/#PB_Structure_AlignC>]
  ...
EndStructure 

Re: AlignC as a keyword

Posted: Sun Jan 07, 2024 3:58 pm
by Quin
Restructuring the help[ could be good, yeah. I agree though, I don't think a new keyword would help.
Fred wrote: Sun Jan 07, 2024 10:02 am I fail to see how it would have help you if you have forget about such functionality :P . Or may be to rework the help syntax here https://www.purebasic.com/documentation ... tures.html

Code: Select all

Structure <name> [Extends <name>] [Align <numeric constant expression/#PB_Structure_AlignC>]
  ...
EndStructure 

Re: AlignC as a keyword

Posted: Sun Jan 07, 2024 4:34 pm
by skywalk
I think he meant EnableAlignC like EnableExplicit.
This way all structures will pad accordingly.
I cannot think of the need for multiple padding types within a single app.
Unless different hardware connected to your app requires it?

Re: AlignC as a keyword

Posted: Sun Jan 07, 2024 6:40 pm
by Caronte3D
+1

Re: AlignC as a keyword

Posted: Sun Jan 07, 2024 6:47 pm
by idle
I could have sworn there was an AlignC I made a macro so no worries until I forget again

Re: AlignC as a keyword

Posted: Sun Jan 07, 2024 7:27 pm
by mk-soft
But maybe 'StructureC' like 'ProcedureC' or 'PrototypeC'. But you can also forget them like AlignC

Re: AlignC as a keyword

Posted: Sun Jan 07, 2024 9:09 pm
by idle
Fred wrote: Sun Jan 07, 2024 10:02 am I fail to see how it would have help you if you have forget about such functionality :P . Or may be to rework the help syntax here https://www.purebasic.com/documentation ... tures.html

Code: Select all

Structure <name> [Extends <name>] [Align <numeric constant expression/#PB_Structure_AlignC>]
  ...
EndStructure 
I have really poor memory these days and forget all sorts of things but I was sure there was once an AlignC, it turns out it was a macro in another one of my codes. Align 4 or Align 16 makes sense but Align #PB_Structure_AlignC not so much