> I checked again and found I was wrong,as your guess in VB editor a tab
> character (chr(9)) will be substituted by a space (chr(32)) automatically
> when pasted,so I tempted to solve this problem by this way:"YndDPW6~E" &
> chr(9) & "YkG^GNP",but when the string was output to the web page,I found
> the tab was substituted by space again! Is looks like tab can't get along
> with VB.
Oops, you're right 9 is Tab, 8 is Backspace (which might also pose a problem).
What do you mean by 'output to the webpage' ?
Is that a function call, a document write thing, what (exactly)?
LFS
jtz - 30 Jun 2008 08:05 GMT
> What do you mean by 'output to the webpage' ?
>
> Is that a function call, a document write thing, what (exactly)?
>
> LFS
well,my end is to encapsulate script in my ASP component,the component
will output the right script according to the client's request.I'll explain
it by a example
ASP code:
......
response.write "<script language = JScript.Encode>"
set ScriptObj=server.createObjet("myComponent.scriptClass")
ScriptObj.outputScript
response.write"</script>"
............
VB code(in class scriptClass):
function outputScript()
..........
response.write "...~E" & chr(9) & "YkG..."
..........
end function
I don't know if I illustate clearly enough,you know my english is poor.
Larry Serflaten - 30 Jun 2008 15:05 GMT
> well,my end is to encapsulate script in my ASP component,the component
> will output the right script according to the client's request.I'll explain
> it by a example
As you see, writing encoded text may be problematic. How about
a different solution? If you output your script to a .js file, you can
use the SRC attribute of the SCRIPT tag to call that file:
ScriptFile = ScriptObject.OutputFileURL
Response.write "<SCRIPT lang = JScript.Encode src = "
Response.Write Chr(34) & ScriptFile & Chr(34)
Response.write "</SCRIPT>
I don't do ASP, so I'm not sure if that is a solution or not. The point
is you might look at other ways to include your script other than using
the write method to send encoded characters....
If you use the src attribute, would the script really need to be encoded?
LFS
jtz - 30 Jun 2008 23:45 GMT
that is a good idea ,I will try.