Discussions related to Visual Prolog
Frank
Posts: 22
Joined: 23 Nov 2014 20:41

Accessing a specific URL from within the code

Unread post by Frank »

Hello,
Environment VP 7.4 Commercial Edition.
I am trying to access an specific URL www.abc.com from within a dialog box when someone clicks on the cancel button. I am using the following code inside the program :

Code: Select all

... predicates     onCancelClick : button::clickResponder. clauses     onCancelClick(_Source ) = button::defaultAction:-       URL = "www.abc.com",     cancel_ctl:navigate(URL). ...
When I compile I get an error message: undeclared identifier ' navigate/1'

I would appreciate any feedback.

Thanks,
Frank
User avatar
Thomas Linder Puls
VIP Member
Posts: 1395
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

A button is a user interface element that can basically receive clicks, to "access a URL" you will need something that can do that.

It is however not clear what you mean by "access a URL". Should it open in an external browser or do you which to load it somewhere in your dialog, or what?
Regards Thomas Linder Puls
PDC
Frank
Posts: 22
Joined: 23 Nov 2014 20:41

Accessing a specific URL from within the code

Unread post by Frank »

Thanks Thomas.

All I want to open the website in an external browser, once the button is clicked.

Or alternatively if it makes it easier, I would like to put a URL link in my dialog box such that once someone clicks on that to open that website in an external browser.

Best,
Frank
Frank
Posts: 22
Joined: 23 Nov 2014 20:41

Accessing a specific URL from within the code

Unread post by Frank »

I was able to find the webBrowser code in the example section that deals with the URLs.
Apparently opening a URL in an external browser is achieved through the webBrowserControl type control( which is not an standard Control) on the Form. But I cannot figure out how to include such a control on a Form.
User avatar
Thomas Linder Puls
VIP Member
Posts: 1395
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

If you want to open an URL in an independent browser, which your program should not otherwise control or interact with, then you should use call shell_api::shellOpen with the URL.

But if you want to open it in a separate browser that your program control, then you should use the internetExplorer class.

And finally if you want to have a web browser embedded directly in your own dialog then you should use the webBrowser control.
Regards Thomas Linder Puls
PDC
Frank
Posts: 22
Joined: 23 Nov 2014 20:41

Accessing a specific URL from within the code

Unread post by Frank »

Thank you Thomas.
For now I used webBrowser control and it works fine for what I wanted to do.

Best,
Frank
Post Reply