Page 1 of 1

Undocumented Features

Posted: Tue Nov 09, 2021 11:01 am
by C87
I wasn't sure where to post this. It is not a Coding issue, Bug, or a Feature Request, so I've gone for Discussion.

The other day from a typo when setting up variables, I came across a series of apparent Constants as follows:
#FD_ACCEPT, #FD_CLOSE, #FD_CONNECT, #FD_ODB, #FD_READ, #FD_SETSIZE, #FD_WRITE
#BLACK, #BLACK_BRUSH, #BLACK_PEN, #BLACKNESS, #BLACKONWWHITE

There are others which I have dropped on before. However, there appears to be no mention of them, or why they exist in HELP or elsewhere. Some others are: #TRUETYPE_FONTTYPE, #TRUNCATE_EXISTING, #IMAGE_BITMAP, #IMAGE_CURSOR, #REFERENCE_BLACK_MAX, #READ_CONTROL, #READ_WRITE....., etc, etc. Hundreds of them it does appear. Also not specifically documented, but within HELP are shown #True (1), #False (0) etc, but only shown within the explanation of Gadgets, not as reserved words. Additionally, the other week I came across a mention of the PureBasic utility PureUnit* in the forums, which resulted in my the discovery of that, plus the DocMaker* and others in the SDK folder. None of these or the Libraries have a mention in HELP.

My point is : When so much time and knowledge has clearly been spent creating these, I cannot understand why it appears there has not been any attempt to mention them. (or is it just me that cannot find them?..........looking and not seeing)

I will say that on the PureBasic website, the Online Documentation is helpful and goes a long way to address Libraries and other aspects.

* these come up in PureBasic Forums but if you didn't know about them, or their names, you'd never find them.

Re: Undocumented Features

Posted: Tue Nov 09, 2021 11:26 am
by jacdelad
Many, many of these constants are built-in Windows API constants. They have no use for you unless you use the API. The constants themselves are described in the documentation by Microsoft. Neither copying it (and it may be subject to changes) nor listing them (and the list grows more or less regularly) makes sense to me.

Re: Undocumented Features

Posted: Tue Nov 09, 2021 11:27 am
by BarryG
C87 wrote: Tue Nov 09, 2021 11:01 amThe other day from a typo when setting up variables, I came across a series of apparent Constants [...] there appears to be no mention of them
Those are Windows API constants, and are mentioned in the manual as predefined constants:

https://www.purebasic.com/documentation ... tants.html

That is, if a constant doesn't start with "#PB_" then they're usually an OS one.

Why aren't they mentioned in detail? For the reason given here in the manual:

https://www.purebasic.com/documentation ... _help.html

It's about 400 MB of data that would need to be included with PureBasic.

Re: Undocumented Features

Posted: Tue Nov 09, 2021 12:42 pm
by C87
Thanks for that jacdelad & BarryG, never had the need for involvement with Win API in PureB but understand now you've explained it.

Re: Undocumented Features

Posted: Tue Nov 09, 2021 9:42 pm
by jacdelad
I don't know whether you use Windows or not and how much you know about Windows API, but if you want to its definitely worth digging a bit into it. Windows API allows you a lot of predefined additions to everything, like gadgets: enabling grouping and tileview in listicon gadgets is what caught my eye (like in the windows explorer). Sooner or late r you'll come across this unavoidably. Same with Linux and Mac OS, but I can't help you there.