Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / VB Syntax / June 2008



Tip: Looking for answers? Try searching our database.

some characters are trimed

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jtz - 29 Jun 2008 11:50 GMT
I pasted a string into VB editor form dreamweaver,and I found the string
pasted modified by VB editor ,some characters had been trimed unawarely.
the oringnal string  "YndDPW6~E    YkG^GNP"
the trimed string    "YndDPW6~E   YkG^GNP"
Does the trimed string look longer?if they are pasted into notepad,you will
see the oringnal string has one more space between "YndDPW6~E" and
"    YkG^GNP" ,it is really confused ,what char on earth had VB editor trimed
and why?the oringal string is part of my encoded script capulated in dll, the
missing char made my script crippled.
appreciate for your help.

Signature

jtz

Larry Serflaten - 29 Jun 2008 13:53 GMT
> I pasted a string into VB editor form dreamweaver,and I found the string
> pasted modified by VB editor ,some characters had been trimed unawarely.
[quoted text clipped - 6 lines]
> missing char made my script crippled.
> appreciate for your help.

This is just a guesss, you'd have to check this yourself, but I would
not be surprised if the editor substituted Chr(8) (Tab character) out
of your original string and added the requrired spaces needed to get
to the next tab stop.....

LFS
jtz - 30 Jun 2008 00:38 GMT
I have checked and found that two space(char(32)) had been trimed,confused...
Larry Serflaten - 30 Jun 2008 01:12 GMT
> I have checked and found that two space(char(32)) had been trimed,confused...

I agree, it is confusing that VB would trim a printable character when pasting....

LFS
jtz - 30 Jun 2008 03:45 GMT
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.
Larry Serflaten - 30 Jun 2008 05:32 GMT
> 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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.