Opening a browser with a URL from WinProlog

102 Views Asked by At

I am trying to implement a help system for a GUI written in Win-Prolog. The obvious approach would seem to be HTML. Is it possible to open a browser with a given URL programatically from within WinProlog? Ideally I'd like to tie the browser open call to a button click or similar event.

2

There are 2 best solutions below

0
Paulo Moura On BEST ANSWER

To open a URL with the user preferred web browser try (assuming the URL is an atom):

open_in_web_browser(URL) :-
    cat(['cmd /c start /D"', URL, "'"], Command, _),
    exec(Command).
0
Zimoto Yosihumi On

Browser can be opened by using a command line.

You can open browser by useing exec predicate given Command line from within win-prolog.

example

 firefox :-
    exec('C:\Program Files (x86)\Mozilla Firefox\firefox.exe','-url http://www.lpa.co.uk/',X).