Page 1 of 1
OS specific constants documentation?
Posted: Tue Jul 16, 2024 8:09 pm
by SMaag
Is there anywhere a documentation of the OS specific constants like #PS$ (Path separator)
I konw there are some OS specific constans but without a central documentation I could not use because I'm not able to find it!
I tried a search for #PS$ in the PB-Help and here in the Forum. But there is no result showing a definition of all possible OS specific constants!
Re: OS specific constants documentation?
Posted: Tue Jul 16, 2024 8:55 pm
by boddhi
SMaag wrote:
Is there anywhere a documentation of the OS specific constants like #PS$ (Path separator) [...]
Hello,
This information is usually given in the instruction help.
I don't know if there are many specific cases like #PS$.
Maybe it can help, you can click on the "History" link in the manual and do a search on the word "constant".
Re: OS specific constants documentation?
Posted: Tue Jul 16, 2024 9:02 pm
by spikey
Have you tried the Structure Viewer tool? It doesn't just show structures...
Using the built-in Tools
Re: OS specific constants documentation?
Posted: Tue Jul 16, 2024 10:09 pm
by BarryG
The closest list would be this ->
https://www.purebasic.com/documentation ... tants.html
But that's only for constants starting with #PB_, which is why #PS$ is not in there.
Re: OS specific constants documentation?
Posted: Tue Jul 16, 2024 10:28 pm
by boddhi
BarryG wrote:
But that's only for constants starting with #PB_, which is why #PS$ is not in there.
In my reply, I had thought of including this link but it doesn't 1) list constants of type #PS$ and 2) specify, when they target a specific OS, which one is concerned.
Re: OS specific constants documentation?
Posted: Tue Jul 16, 2024 10:37 pm
by BarryG
SMaag wrote: Tue Jul 16, 2024 8:09 pmthere is no result showing a definition of all possible OS specific constants
This manual topic shows which commands are specific to a certain OS ->
https://www.purebasic.com/documentation ... cific.html
So you'd be able to look at each command and see which OS-specific constants they use (if any). Does that help?
Note: I don't think PureBasic has OS-specific constants anyway. For example, #PS$ can be used on all Operating Systems.
Re: OS specific constants documentation?
Posted: Tue Jul 16, 2024 10:41 pm
by Quin
BarryG wrote: Tue Jul 16, 2024 10:37 pm
Note: I don't think PureBasic has OS-specific constants anyway. For example, #PS$ can be used on all Operating Systems.
I think they meant constants that have a different value depending on platform, for example #PS$ would be "\" on Windows and "/" on Mac/Lin.
There are platform-specific constants, but they're only used in the API functions, like #MAX_PATH for the Windows API
Re: OS specific constants documentation?
Posted: Tue Jul 16, 2024 11:05 pm
by boddhi
BarryG wrote:
Note: I don't think PureBasic has OS-specific constants anyway. For example, #PS$ can be used on all Operating Systems.
There are!
Some examples:
#PB_Button_MultiLine supported on Windows & Linux but not on MacOS
#PB_FontRequester_Effects is Windows only

Re: OS specific constants documentation?
Posted: Wed Jul 17, 2024 12:16 am
by BarryG
Thanks, boddhi. I stand corrected and TIL.

Re: OS specific constants documentation?
Posted: Wed Jul 17, 2024 8:56 am
by SMaag
First thanks to all! Yes I know all this documentation you gave me as link!
I know and use the buildin tools for structure and constants.
What I see in the answers is: Os specific constans is like a deep secret!
How should we search for this OS specific constans if we don't know the names:
As an example the #PS$: Os specific PathSeparator
(if I look in the Structure viewer I can see only the value on my OS not for other OS)
I request a list of all this OS specific constants with their full names and the values on the different OS.
If this is not existing we should make this list for us! If we have this list, we should request to integrate it into PB help!
Re: OS specific constants documentation?
Posted: Wed Jul 17, 2024 9:05 am
by SMaag
My resarch result until know
Code: Select all
; OS specific FileSystem constants
; Windows
#PS = 92 ; '\'
#NPS = 47 ; '/'
#PS$ ="\\"
#NPS$ "/"
Re: OS specific constants documentation?
Posted: Wed Jul 17, 2024 11:07 am
by Axolotl
IMHO the reason of these kind of constants is, that we do not have to care about the value behind them.
Code: Select all
; Linux (according to your research)
#PS = 47 ; '\'
#NPS = 92 ; '/'
#PS$ = "/"
#NPS$ = "\\" ; <- syntax highlighter needs two \ to look correct.
From my point of view, the constants that cannot be used under all supported OSs should be documented in particular.
Re: OS specific constants documentation?
Posted: Wed Jul 17, 2024 12:11 pm
by AZJIO
AutoCompletionIDE - there is a file here "\config\AutoCompletionIDE\7-API_Const". There are 1436 constants.
Using
CaptureText (made on AutoIt3) I pulled 16222 constants from the IDE window (IDE->Tools->Structure Viewer->Constants)