Solved

HyperlinkToURL

Posted on 2006-10-24
3
788 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 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
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.

761 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