Announcement

Collapse
No announcement yet.

I think there's a bug in PB35's binary file handling...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • I think there's a bug in PB35's binary file handling...

    I recently have been working on a program to handle uncompressed file 'archives'
    and I seem to have run into an odd bug. I tried to use the SEEK command to set the
    file pointer, but it doesn't seem to work correctly, as the following GET
    returned a stream of bytes from the beginning of the file. the same occured
    when I tried to set the position within the get statement. Is there a way
    to work around this, or am I possibly missing something? thanks.

  • #2
    If you are going to claim that there is a bug in a product that has been shipping for years with no such known problem, the least you could do is post some source code to demonstrate the problem.

    The file I/O code in PowerBASIC has not changed for many years and there has NEVER been a problem with it. If you believe otherwise, please post some code.

    Thanks!

    --Dave


    -------------
    PowerBASIC Support
    mailto:[email protected][email protected]</A>

    Home of the BASIC Gurus
    www.basicguru.com

    Comment


    • #3
      I have been using PB's file access for years ... in all forms, sequential text files, random access files, and binary files. I've never seen or heard of any sort of problem. Dave's right, post some code so we can take a look.

      Jason

      Comment


      • #4
        [quote]
        I recently have been working on a program to handle uncompressed file 'archives'
        and I seem to have run into an odd bug. I tried to use the SEEK command to set the
        file pointer, but it doesn't seem to work correctly, as the following GET
        returned a stream of bytes from the beginning of the file. the same occured
        when I tried to set the position within the get statement. Is there a way
        to work around this, or am I possibly missing something? thanks.
        {/quote]

        HMM, if:
        SEEK #H%, SeekPos
        followed by
        GET #H, , anything
        returns bytes from the start of the file...

        Sounds to me like "SeekPos" was equal to zero.

        Did you initialize SeekPos? Did you mispell it?

        That, or you are a Microsoft BASIC refugeee, and expected SEEK #H%,0 to position the file *after* the first byte...

        Post code, use $DIM ALL

        MCM

        Michael Mattias
        Tal Systems (retired)
        Port Washington WI USA
        [email protected]
        http://www.talsystems.com

        Comment


        • #5
          My apologies. I jumped to a hasty conclusion and a reckless accusation
          I converted my program to QuickBasic, and it gave me the same results. It
          was a big blunder on my part.

          I posted the source code (It's a zip file.. nothing compiled) at http://www.fortunecity.com/skyscrape...68/Problem.zip

          Again, I apologize for the hasty accusation, and I appreciate any help.

          Comment


          • #6
            YOur example code has no provision to call the "problematic" subroutines that are REMmed out. It is not clear (at least to me!) from your example code whether the results are correct or incorrect.

            I note that the code changes the default segment and intermixes binary file mode with random access GET# statement (which slightly convolutes the code). From the looks of the code, you are just pulling "data" from a file once the file is parsed, right?

            Please redo your example code to clearly show whether the results it displays are right or wrong. Thanks!


            -------------
            Lance
            PowerBASIC Support
            ( mailto:[email protected]owerbasic.com[email protected]</A> )
            Lance
            mailto:[email protected]

            Comment

            Working...
            X