473,382 Members | 1,512 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,382 software developers and data experts.

Converting VBScript ChrB and AscB to JavaScript

Hi All,

I am trying to convert an ASP upload script from VBScript to javascript:
http://www.freeaspupload.net/

I am stuck on this function:

//String to byte string conversion
function byte2String(sString)
{
var result = new String();

for (var index = 0; index < sString.length; index ++)
{
result += ChrB(AscB(Mid(sString,i,1)));
} // end for

return result;
} // end function
Obviously the line I am stuck on is:
result += ChrB(AscB(Mid(sString,i,1)));
Are there any IIS JavaScript equivalents for ChrB and AscB?

Any help would be most appreciated!

Rob
:)
Jul 23 '05 #1
2 7569
In article <41***********************@news.optusnet.com.au> , "Robert Mark
Bram" <none> enlightened us with...
Hi All,
Obviously the line I am stuck on is:
result += ChrB(AscB(Mid(sString,i,1)));
Are there any IIS JavaScript equivalents for ChrB and AscB?


I found this via google. Don't know if it works.
ChrB(AscB(chr))
JScript equivalent:
chr.charCodeAt(0) & 255;

You'd have to use substring functions to replace the Mid.

--
--
~kaeli~
I can't sleep.
The clowns might eat me.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #2
> I found this via google. Don't know if it works.
ChrB(AscB(chr))
JScript equivalent:
chr.charCodeAt(0) & 255;


Thank you Kaeli,

Try not to be too afraid of the clowns.. :)

Rob
:)
Jul 23 '05 #3

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

Similar topics

5
by: John Davis | last post by:
When I create new documents in Dreamweaver, there are several choices for ASP creation: ASP JavaScript: run at client side?? ASP VBScript: run at server side?? ASP.NET C# ASP.NET VB I don't...
29
by: Christopher Brandsdal | last post by:
If I have a .ASP page that runs JScript code - is it possible to include an ..ASP page that runs VBscript???
3
by: John MacIntyre | last post by:
Hi, Can anybody give me a hint as to how to convert a javascript array into a vbscript array? BTW-it only needs to work in IE5 & 6 Thanks in advance, John MacIntyre VC++ / VB / ASP /...
3
by: Mark Fox | last post by:
Hello, I am porting some old ASP 3.0 VBScript code to C#.NET and am not sure what the equivalent C# functions are for a couple VBScript functions. So my first question is: 1) Is there...
6
by: Julien | last post by:
Hello, I have some files located in a file server and managed by a SQL database from a web based interface using ASP + VBSCRIPT technology. I need to automatically copy those files to a web...
10
by: Shadow Lynx | last post by:
That subject packs a whallop, so let me explain in better detail what's happening and how it relates to ASPX pages... In a nutshell, if the first <script /on a page is of type "text/vbscript",...
1
by: Matt Gyton | last post by:
Can anyone help me, I need a way to convert a date in DD/MM/YYYY format (the time is also present but that's not too important in this case....) into a UTC integer using ASP/VBScript....for...
3
by: Pascal | last post by:
Hello can someone help please ? here is the code in vb6 Dim lChar As Integer lChar =AscB(Mid(sMessage, lByteCount + 1, 1)) i tried lChar = System.Convert.ToUInt16(Asc(Mid(sMessage,...
4
by: arunfr | last post by:
Hi , I have tried all the methods available to convert byte () to string and vice versa in VBSCRIPT. Function ByteArray2Text(varByteArray) Dim rs Const adLongVarChar = 201 Set rs =...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.