Below from 22nd January 2019... "Added: #PS, #NPS, #PS$ and #NPS$ constants (Path seperator character depending of the OS)" https://www.purebasic.com/news.php
Last edited by Oso on Mon Jan 30, 2023 7:43 pm, edited 1 time in total.
Thanks for trying this, NicTheQuick. That confirms what I originally thought, which is that #PS$ can be used on both Windows and Linux, without needing anything further. I remembered a post from BarryG a few weeks ago but couldn't find it. When I looked in the manual today, it's a bit confusing.
collectordave wrote: Tue Nov 08, 2022 3:38 pm
I have found that #PS$ returns "\" on windows and "/" on the Mac which seems to be correct.
Can anyone explain the use of #NPS$ it is the N which is getting me.
Thanks. Yes, I was thinking exactly the same thing. The only reason I could possibly come up with, is if you're writing some code on Windows that generates some kind of output for Linux/Mac. For instance, building an ftp script to a Linux client. Yeah, it still seems weird though.
Demivec wrote: Tue Nov 08, 2022 5:27 pm
From what I understand, #NPS$ is the 'Not' Path Separator string. In other words, the one for other OS's.
Yes, a good way to describe it. After you put it that way, I realised it could be very useful for validating a user's input of a pathname, i.e. to stop the user from entering that character because it isn't going to work on the system.
It's easier than checking for the use of the valid character.