CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 1999
    Location
    Pune, MH, India.
    Posts
    453

    How to handle Safe arrays in VBScript (ASP)

    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

  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: How to handle Safe arrays in VBScript (ASP)

    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.


  3. #3
    Join Date
    May 1999
    Location
    Pune, MH, India.
    Posts
    453

    Re: How to handle Safe arrays in VBScript (ASP)

    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

  4. #4
    Guest

    Re: How to handle Safe arrays in VBScript (ASP)

    try this:

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





Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured