Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CHALLANGE ! Dangerous Maze
#11
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.
Reply


Messages In This Thread
CHALLANGE ! Dangerous Maze - by MasterGy - 12-03-2023, 06:15 PM
RE: CHALLANGE ! Dangerous Maze - by mnrvovrfc - 12-03-2023, 07:40 PM
RE: CHALLANGE ! Dangerous Maze - by justsomeguy - 12-04-2023, 03:56 AM
RE: CHALLANGE ! Dangerous Maze - by MasterGy - 12-04-2023, 03:19 PM
RE: CHALLANGE ! Dangerous Maze - by justsomeguy - 12-04-2023, 05:47 PM
RE: CHALLANGE ! Dangerous Maze - by MasterGy - 12-04-2023, 06:12 PM
RE: CHALLANGE ! Dangerous Maze - by TerryRitchie - 12-04-2023, 06:12 PM
RE: CHALLANGE ! Dangerous Maze - by MasterGy - 12-04-2023, 06:14 PM
RE: CHALLANGE ! Dangerous Maze - by TerryRitchie - 12-04-2023, 06:20 PM
RE: CHALLANGE ! Dangerous Maze - by justsomeguy - 12-04-2023, 07:04 PM
RE: CHALLANGE ! Dangerous Maze - by mnrvovrfc - 12-04-2023, 07:24 PM
RE: CHALLANGE ! Dangerous Maze - by MasterGy - 12-04-2023, 08:37 PM
RE: CHALLANGE ! Dangerous Maze - by justsomeguy - 12-04-2023, 09:26 PM
RE: CHALLANGE ! Dangerous Maze - by MasterGy - 12-28-2023, 11:36 AM



Users browsing this thread: 1 Guest(s)