code=GLBasic V5+6
FUNCTION DIRECTORY:
// returns current working directory
// FORMAT: dir$=DIRECTORY()
RETURN REPLACE$(GETCURRENTDIR$(),CHR$(47),CHR$(92))
ENDFUNCTION
dir$=DIRECTORY()+"subdirectory"
EXPLORE(dir$)
FUNCTION EXPLORE: dir$
// opens explorer in specified directory
// FORMAT: EXPLORE(dir$)
SHELLCMD("explorer.exe "+dir$,TRUE,TRUE,rv)
ENDFUNCTION
Combined for simplicity, opens explorer in working directory
FUNCTION EXPLORER:
// opens explorer in working directory
// FORMAT: EXPLORER()
ok$=REPLACE$(GETCURRENTDIR$(),CHR$(47),CHR$(92))
SHELLCMD("explorer.exe "+ok$,TRUE,TRUE,rv)
ENDFUNCTION
why not using:
path$ = REPLACE$("/", "\\")
Thats to simple with REPLACE :D :good:
Quote from: Kitty Hello on 2008-Oct-02
why not using:
path$ = REPLACE$("/", "\\")
FUNCTION HF_GETCURRENTDIR$:
RETURN REPLACE$(GETCURRENTDIR$(),CHR$(47),CHR$(92))
ENDFUNCTION
I had to use character codes, the ascii seems to trigger the debugger, its complaining about arguement #'s
Danke :)
Right. That's a bug in V5. Fixed in next version.