Click to See Complete Forum and Search --> : How to handle Safe arrays in VBScript (ASP)


unicman
July 27th, 1999, 12:20 AM
Hi,

I am developing an ASP, where I want to analyse the contents read using 'Request.ReadBinary'.

When I read help for the function, it said it returns SafeArray.

Q1. Can anyone tell me how to handle SafeArray in VBScript?
Q2. If not, Can I handle SafeArray in VB (by developing a COM component)?

When I searched for help on SafeArray, I found a topic in InterDev help, but for that I will have to use JScript.

Q2. Can I use combination of VBScript and JScript to execute on server-side?

Thanx in advance.

- UnicMan
http://members.tripod.com/unicman

Lothar Haensler
July 27th, 1999, 01:50 AM
the method name is BinaryRead, not ReadBinary.
Q1. all arrays in VBScript are SafeArray AFAIK
Q2. yes, you can handle SafeArrays in VB
Q3. Yes, you can use both VBScript and JScript on the server side.

unicman
July 27th, 1999, 07:23 AM
Yep! I got jumbled ... its BinaryRead.

Anyway, I am trying foll code ....


<%
iTB = Request.TotalBytes
data = Request.BinaryRead( iTB )
%>




Here I am getting SafeArray. Now here I want to access data "byte-by-byte".
When I do 'TypeName(data)' It recognizes it as 'Byte()' i.e. byte array.
Now how do I access each byte in it?

Thanx in advance

- UnicMan
http://members.tripod.com/unicman

July 27th, 1999, 07:25 AM
try this:

for i = 0 to ubound(data)
do something with "data(i)"
next