QB64.org Forum
Active Forums => Programs => Topic started by: SierraKen on August 09, 2019, 12:38:03 am
-
I'm sure you guys have talked about this before. But it's all new to me :). Tonight I found out how to load a website address URL from QB64 to your default web browser by using the SHELL command. Here is my little example program. It uses the START command built into Windows.
_TITLE "URL Website Browser Loader" PRINT "URL Website Browser Loader" PRINT "Type URL here to load with your default browser."
-
INPUT url$
IF INSTR(_OS$, "[WINDOWS]") THEN
SHELL url$
ELSE
SHELL "xdg-open " + url$
END IF
Use the above to open web pages in both Windows and Linux.
-
That's interesting, you also don't use the START command and it works fine in Windows. I just tried putting just a URL in Windows Command Prompt and it won't work that way lol. Pretty cool.
-
Well
we need only that somebody says us how to do for MAC/OS
-
Well
we need only that somebody says us how to do for MAC/OS
SHELL "xdg-open " + url$ works for MAC as well as Linux, I believe.
-
SHELL "xdg-open " + url$ works for MAC as well as Linux, I believe.
Regretfully xdg-open does not function on MacOS, at least the latest version (10.14.6) anyway.
I've figured the solution for MacOS :)
SHELL "open -a safari https://" + url$