0

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.

Paulo Moura
  • 18,373
  • 3
  • 23
  • 33
bph
  • 10,728
  • 15
  • 60
  • 135

2 Answers2

1

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).
1

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).
Paulo Moura
  • 18,373
  • 3
  • 23
  • 33