OS specific constants documentation?

Just starting out? Need help? Post your questions and find answers here.
SMaag
Enthusiast
Enthusiast
Posts: 327
Joined: Sat Jan 14, 2023 6:55 pm
Location: Bavaria/Germany

OS specific constants documentation?

Post 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!
boddhi
Enthusiast
Enthusiast
Posts: 524
Joined: Mon Nov 15, 2010 9:53 pm

Re: OS specific constants documentation?

Post 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".
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
User avatar
spikey
Enthusiast
Enthusiast
Posts: 778
Joined: Wed Sep 22, 2010 1:17 pm
Location: United Kingdom

Re: OS specific constants documentation?

Post by spikey »

Have you tried the Structure Viewer tool? It doesn't just show structures...
Using the built-in Tools
BarryG
Addict
Addict
Posts: 4219
Joined: Thu Apr 18, 2019 8:17 am

Re: OS specific constants documentation?

Post 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.
boddhi
Enthusiast
Enthusiast
Posts: 524
Joined: Mon Nov 15, 2010 9:53 pm

Re: OS specific constants documentation?

Post 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.
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
BarryG
Addict
Addict
Posts: 4219
Joined: Thu Apr 18, 2019 8:17 am

Re: OS specific constants documentation?

Post 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.
Quin
Addict
Addict
Posts: 1135
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: OS specific constants documentation?

Post 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
boddhi
Enthusiast
Enthusiast
Posts: 524
Joined: Mon Nov 15, 2010 9:53 pm

Re: OS specific constants documentation?

Post 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
 
:wink:
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
BarryG
Addict
Addict
Posts: 4219
Joined: Thu Apr 18, 2019 8:17 am

Re: OS specific constants documentation?

Post by BarryG »

Thanks, boddhi. I stand corrected and TIL. :)
SMaag
Enthusiast
Enthusiast
Posts: 327
Joined: Sat Jan 14, 2023 6:55 pm
Location: Bavaria/Germany

Re: OS specific constants documentation?

Post 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!
SMaag
Enthusiast
Enthusiast
Posts: 327
Joined: Sat Jan 14, 2023 6:55 pm
Location: Bavaria/Germany

Re: OS specific constants documentation?

Post by SMaag »

My resarch result until know

Code: Select all

; OS specific FileSystem constants

; Windows
#PS = 92    ; '\'
#NPS = 47   ; '/'
#PS$ ="\\"
#NPS$ "/"
Axolotl
Addict
Addict
Posts: 873
Joined: Wed Dec 31, 2008 3:36 pm

Re: OS specific constants documentation?

Post 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.
Just because it worked doesn't mean it works.
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
AZJIO
Addict
Addict
Posts: 2225
Joined: Sun May 14, 2017 1:48 am

Re: OS specific constants documentation?

Post 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)
Post Reply