473,386 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

VB script, driving me crazy; vb bug ?

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.8 B.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

Jan 30 '08 #1
3 1972
the difference would be the IIS version so you may want to post your question here:

Microsoft\Outlook Express\microsoft.public.inetserver.iis
Jan 30 '08 #2
On Jan 30, 2:03 pm, "Jon Paal [MSMD]" <Jon nospam Paal @ everywhere
dot comwrote:
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
Jan 30 '08 #3
al**********@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.
Jan 30 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: dont bother | last post by:
This is really driving me crazy. I have a dictionary feature_vectors{}. I try to sort its keys using #apply sorting on feature_vectors sorted_feature_vector=feature_vectors.keys()...
2
by: Silas | last post by:
Hi. This Link Description script is driving me crazy. The first URL below is the script exactly as I got it from javascriptsource.com, which works fine. But as soon as I replace the linktext with...
0
by: Shapper | last post by:
Hello, I have this code in Global.asax: Sub Session_Start(Sender As Object, E As EventArgs) Dim cookie As HttpCookie = Request.Cookies("MyCookie") If Not cookie Is Nothing Then...
1
by: Miguel Dias Moura | last post by:
Hello, I have been trying, for days, to retrieve a control's ClientId in a javascript function. I am using a master page and this is why I need to retrieve the Control's ClientId. The control...
5
by: Pupeno | last post by:
Hello, I am experiencing a weird behavior that is driving me crazy. I have module called Sensors containing, among other things: class Manager: def getStatus(self): print "getStatus(self=%s)"...
3
by: squash | last post by:
I have spent two hours trying to make sense of this script, called crazy.php. The output should be nothing because $cookie_password is nowhere defined in this script, correct? But it actually...
3
by: rashpal.sidhu | last post by:
Please help, this problem is driving me crazy !! I am using metaphone to create phonetic keys. When i run the module stand-a-lone it works fine. I'm trying to create a runner for informix...
5
by: Seer | last post by:
Hi. This is driving me crazy so I hope someone will help! I am using chickenfoot and javascript to try and achieve something that should be really simple. Basically a script that navigates...
5
by: mark4asp | last post by:
Every time the function below is called I get the alert. So I put a deliberate error in there and I check the value of (reportType=='MANDATE') in Firebug, which is found to be true. But still the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.