Jump to Real's How-to Main page

Encode/decode URL's parameters

Powerscript doesn't provide functions like Javascript's escape/unescape or Java's encode/decode.

The trick to use the Javascript engine from Powerscript.

OleObject wsh
Integer  li_rc
string ls_temp

wsh = CREATE OleObject
li_rc = wsh.ConnectToNewObject( "MSScriptControl.ScriptControl" )
wsh.language = "javascript"

ls_temp = wsh.Eval("escape('H e l l o')")

MessageBox( "ESCAPE" , ls_temp)

ls_temp = wsh.Eval("unescape('" + ls_temp + "')")

MessageBox( "UNESCAPE" , ls_temp)

If you find this article useful, consider making a small donation
to show your supportfor this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2005
[ home ]