Loading ...
Sorry, an error occurred while loading the content.

47389Re: [LIBERTYBASIC] Binary File Question

Expand Messages
  • gfcanida@yahoo.com
    Mar 7, 2014
    • 0 Attachment

      I looked at the asc and read this :

      Print asc( "" ) produces: 0

      The input reads up to the end of record excluding the end of record

      So when you reach 0A, 0D or 11 byte$ gets = to "" which translate to hex 00

      Hope this helps, let me know.


      -------Original Message-------

      From: Fred Jensen
      Date: 3/8/2014 00:42:30
      To: libertybasic@yahoogroups.com
      Subject: [LIBERTYBASIC] Binary File Question

      I have a binary file that I want to read sequentially, one byte at a
      time. My code is:
      ----------begin code
      open "Binary.txt" for output as #O
      filedialog "Open File", "*.*", filename$
      open filename$ for binary as #I
      print #O, "Length=";l;" Pos: ";fpos
      while fpos<l
      seek #I, fpos
      input #I, byte$
      print #O, fpos;": ";c$
      close #I
      close #O
      -----------end code

      This is just a little test program to try and figure out what's
      happening. It is supposed to read one byte, convert it to hex, then
      print the byte# and and the byte in hex to an output file and repeat for
      each byte in the file [around 5,800 or so]. By and large, it seems to
      work however a 0x0D byte gets translated to 0x00, a 0x0A to 0x00 and
      0x11 also becomes 0x00.

      Can someone point me toward what I've missed here [I know I've missed


      Fred K6DGW
      Auburn CA USA

      [Non-text portions of this message have been removed]
    • Show all 7 messages in this topic