12-16-2022, 07:41 PM
(12-16-2022, 07:27 PM)Pete Wrote: I think I get it now. So this keyword is for non-compiled code, meaning if I post code here that could be compiled by by a Linux user (All compatible keywords) when that person compiled it, their _OS$ would show they compiled it on a Linux system and as it runs, if we encounter a situation when it needs to read a directory, it will branch to the Linux format with forward slashes, rather than the Windows one, which is the only OS that uses back slashes.
Code: (Select All)IF INSTR(_OS$, "[WINDOWS]") THEN slash$ = "\" else slash$="/"
If I missed something, let me know. If not, thanks for the explanation.
Pete
Old dogs can learn new tricks, but if helps if the neighbor locks up her poodle.
You've got it. That's exactly what it's for.
Though I tend to use the $IF routines more personally.
Code: (Select All)
$IF WIN THEN
slash$ = "\"
$ELSE
slash$ = "/"
$END IF
With the above, the precompiler choses one branch, or the other, and completely ignores everything else. When it comes to actually compiling, all of that's just a single line of code, with the assignment of slash$ dependent upon the users OS.