12-04-2023, 07:24 PM
(This post was last modified: 12-04-2023, 07:25 PM by mnrvovrfc.
Edit Reason: Fixed a typographical mistake.
)
Code: (Select All)
INSTR(, _OS$, "[WINDOWS]")
'^ ^
'| |
Do not do this because QB64 doesn't like it. No need for that stray comma if the starting position of the string is not needed in the search.
Yes it is a PITA to have to reserve a string variable or constant for the directory separation character. But I'm with Terry, do something like this:
Code: (Select All)
'near beginning of top-level code
DIM dirsep$
$IF WIN THEN
dirsep$ = "\"
$ELSE
dirsep$ = "/"
$END IF
'later in the program:
uni_bord = _LOADIMAGE(osFix$("need" + dirsep$ + "menu" + dirsep$ + "bord" + dirsep$ + "uni_bord.jpg"), 32)
It looks sloppy, however. It might be better to do what justsomeguy proposed. To call a "helper" string function that changes the slash character depending on the operating system the program is running in.