Solved

HyperlinkToURL

Posted on 2006-10-24
3
784 Views
Last Modified: 2013-12-26
Hi
I use the HyperlinkToURL ( string url ) function of the Inet object, but I have problems with the url.

I need encode the arguments values of the url same as java do it with java.net.URLEncoder.encode(String s).

Thanks.
0
Comment
Question by:sarevalo
3 Comments
 
LVL 6

Accepted Solution

by:
tr1l0b1t earned 250 total points
ID: 17833022
Hi,

You could use the Javascript engine from PowerScript
and use the "escape" function. A working sample script :

--------------8<--------------8<--------------8<--------------

OleObject l_ole
Inet lsvc_inet
String ls_temp

// URL to encode
String ls_URL = "www.yourpage.com/sample page with spaces.htm"

l_ole = CREATE OleObject
If l_ole.ConnectToNewObject("MSScriptControl.ScriptControl") = 0 Then
      l_ole.language = "javascript"
      // encode
      ls_temp = l_ole.Eval("escape('" + ls_URL + "')")
      DESTROY l_ole
Else
      MessageBox("Error1", "...")
      Return -1
End If

// finally we open the encoded URL
If GetContextService("Internet", lsvc_inet) > 0 Then
      lsvc_inet.HyperlinkToURL( ls_temp )
Else
      MessageBox("Error2", "...")
End If

--------------8<--------------8<--------------8<--------------

Hope it helps
Regards
0
 

Author Comment

by:sarevalo
ID: 17833811
Thanks, yours solution was helpful for me.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now