VB script, driving me crazy; vb bug ?

VB script, driving me crazy; vb bug ?

am 30.01.2008 18:15:23 von albertlaszlo

I have a very simple vb code, that suppose to remove some binary
character codes from a string. The results are different if the code
is running from IIS-WinXp or IIS-WinServer. After hours of searching I
managed to isolate the code that is creating the problem, but i cannot
understand why. Here is the code :
Z1.asp
<%
function Hexof(s)
dim ix, so
for ix =1 to len(s): so = so & Hex(Asc(Mid(s,ix,1))) & ".": next
HexOf = so
end function

Function Test()
Dim ix, s1

s1=""
For ix = 127 To 191: s1 = s1 & chr(ix): next
response.write "127..191....." & Hexof(s1)

End Function

test
%>

The results I get in IE 6, are :
for IIS on Win XP (INCORRECT?)
127..191.....7F.0.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F. 7F.7F.7F.
7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F. 7F.7F.7F.
7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F.7F. 7F.7F.7F.

for IIS on Win 2000 server (as expected):
127..191.....7F.80.81.82.83.84.85.86.87.88.89.8A.8B.8C.8D.8E .8F.
90.91.92.93.94.95.96.97.98.99.9A.9B.9C.9D.9E.
9F.A0.A1.A2.A3.A4.A5.A6.A7.A8.A9.AA.AB.AC.AD.AE.AF.B0.B1.B2. B3.B4.B5.B6.B7.B8.B9.BA.BB.BC.BD.BE.BF.

the funny part is that if run the same script from different locations
in the same IE session, I get inconsistent result
1. running XP\z1.asp returns the INcorrect result
2. running server\z1.asp returns the correct result
3. running XP\z1.asp returns the CORRECT result Surprised ?
I really am

Somebody might help me to get this thing out of my mind

Thanks
Laszlo

Re: VB script, driving me crazy; vb bug ?

am 30.01.2008 20:03:27 von Jon Paal

the difference would be the IIS version so you may want to post your question here:

Microsoft\Outlook Express\microsoft.public.inetserver.iis

Re: VB script, driving me crazy; vb bug ?

am 30.01.2008 20:33:17 von albertlaszlo

On Jan 30, 2:03 pm, "Jon Paal [MSMD]" dot com> wrote:
> the difference would be the IIS version so you may want to post your question here:
>
> Microsoft\Outlook Express\microsoft.public.inetserver.iis

They are the same version.
I will post it in the indicated spot

Thanks

Laszlo

Re: VB script, driving me crazy; vb bug ?

am 30.01.2008 20:40:01 von reb01501

albertlaszlo@gmail.com wrote:
> I have a very simple vb code, that suppose to remove some binary
> character codes from a string. The results are different if the code
> is running from IIS-WinXp or IIS-WinServer.

I'm at a loss. I have tested your code on multiple servers (from NT4 to
to XP to WS2003) running versions of IIS from 5-6, on IE6 and IE7, and I
get the same result no matter where or how I run the code.

I don't believe the result of this code should depend on regional
settings or encoding, but I can think of nothing else that would come
close to explaining your results. You should try testing the code as a
..vbs file, varying your regional settings to see if they have any effect
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.