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

47391Re: [LIBERTYBASIC] Binary File Question

Expand Messages
  • Fred Jensen
    Mar 8, 2014
      > The code you have used is overcomplicated, and will be slow because of
      > the constant 'seeking' you do to reposition the file pointer.

      I admit to being a dinosaur. When I started, we were called
      "programmers" and no one was a "software engineer." Indeed, the word
      "software" wouldn't be invented until much later. I suspect I have
      forgotten more programming languages than most folks today even know
      existed, and most of those don't exist any more [no one I know mourned
      the demise of APL :-)].

      Last year I built a 40-station irrigation controller for my wife to
      replace 6 aging timers in the basement. The controller is from the
      Hamstack components [Microchip 18F46K22] programmed in C. I was having
      trouble with one of John's C-library routines and when I sent him my
      example code he replied, "Wow! You write C as if it was FORTRAN." The
      Windows segment for wife's PC to allow her to visually build and load
      her irrigation schedules into the controller was my introduction to LB.

      You seem
      > not to have noticed that Liberty BASIC provides a specific function for
      > reading a single byte from a file:
      >
      > byte$ = input$(#I, 1)

      I had not noticed that but have now and I'll try that, just getting
      8-bit bytes sequentially is all I want to do. Someone else has
      suggested that the problem I'm seeing is in the asc() function which,
      when given 0x0D returns zero.

      Thanks and best regards,

      Fred K6DGW
      Auburn CA USA

      PS: My Perl makes those aficionados wince. :-)
    • Show all 7 messages in this topic