ASPvbscript - Reading Binary files

Results 1 to 2 of 2

Thread: ASPvbscript - Reading Binary files

  1. #1
    HopinGator Guest

    Default ASPvbscript - Reading Binary files

    I am trying to read a binary file that contains a Single precision floating point number. It appears only reading text files is possible with standard ASP objects. So...i tried to read it as text.<BR><BR>My file has the first 4 bytes 00:A0:BE:45 ( This is 6100 in single precision floating point)<BR><BR>I use the objTSO.Read(4) function to read the first 4 characters.<BR><BR>Ultimately I want to be able to Display 6100 to the screen.<BR><BR>tmpString = objTSO.Read(4) &#039 - Variant of subtype String<BR>tmpNumber = CSng(tmpString) &#039 - vbscript error <BR>Respsonse.Write "Value = " & tmpNumber &#039 - should display 6100<BR><BR>Thanks for any help,<BR>HopinGator

  2. #2
    HopinGator Guest

    Default RE: ASPvbscript - Reading Binary files

    I just tried something else...<BR><BR>tmpNumber = LeftB(String,4) &#039 this grabs the first 4 bytes of the string.. but how do I get it to treat tmpNumber like its a Single Precision floating piont ?<BR><BR>Should I just abandon this and user Javascript to this this particular function ?

Posting Permissions

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