Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

HyperlinkToURL

Posted on 2006-10-24
3
Medium Priority
?
805 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 6

Accepted Solution

by:
tr1l0b1t earned 750 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

660 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