>Is the an API call hiding somewhere that I can use to URL encode an argument string to send to a web page?
>
>? f( "test this?" ) && would return test%20this%3F
>
>I know that something like this has to exist because if you look at the LocationURL inside an IE object it comes back encoded. The problem is I can't actually call the Navigate() method until the arglist has been encoded.
>
>I'm looking for an API because it's got to be at least an order of magnitude faster than VFP code could do it.
To go along with Greg Reichert idea with VBScript you can use the ScriptControl if you don't want to use WSH
lo_Script = NEWOBJECT('scriptcontrol')
lo_Script.Language = "VBScript"
? lo_Script.Eval('escape("test this?")')
or you can make a VB Function
lc_code = [Function Encode(pc_text)] + CHR(13) + CHR(10) + ;
[ Encode = escape(pc_text)] + CHR(13) + CHR(10) + ;
[End Function]
lo_Script = NEWOBJECT('scriptcontrol')
lo_Script.Language = "VBScript"
lo_Script.AddCode(lc_code)
? lo_Script.Run('Encode', "test this?")
? lo_Script.Run('Encode', FILETOSTR(HOME()+ "FOXTOOLS.FLL"))
Charles
"The code knows no master." - Chuck Mautz
"Everybody is ignorant, only on different subjects." - Will Rogers