Solved

HyperlinkToURL

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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JTable - Group/UnGroup/Drag&Drop 2 111
C#  WebForms or MVC 4 137
Eclipse IDE - Cannot copy/paste from console output 8 390
Online file editor, manager 6 125
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: …
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.
Suggested Courses

751 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