Re: Qwk Help

 BBS: Inland Empire Archive
Date: 10-22-92 (10:18)             Number: 385
From: MARK CUNNINGHAM              Refer#: NONE
  To: JOHN GALLAS                   Recvd: NO  
Subj: Re:  Qwk Help                  Conf: (2) Quik_Bas
> I'm working on writing a little qwk reader.  I've got alotta docs about the
>qwk format, and I was able to make a program that'd go through the
>messages.dat file and print out all the messages, but I
>want to be ablt to go
>through the file conference by conference, and in order to
>do that, I'll have
>to use the .NDX files.  The structure for them goes like this:
[skipping stuff]
>The problem is, the single integer <the first 4 bytes per record> returns
>some number in the negative billions!  My OLXTD doesn't
>seem to have any kind
>of problem with the ndx files, so why am I?!

John, here's a little snipped of code that works for me.

        FLEN& = LOF(X%)       ' how long is the index file?
        Msgs = FLEN& \ 5      ' number of 5-byte entries in the index file
        REDIM MSN&(Msgs)      ' set up the array of offsets

        x$ = SPACE$(5)                'each Index entry is 5 bytes long
        GET #X%, , x$                 ' get the first entry

        conf = ASC(RIGHT$(x$, 1))   'fifth byte is conference number
        MSoff$ = LEFT$(x$, 4)       'first 4 bytes is offset in ms binary
        MSN&(1) = CVSMBF(MSoff$)    '<- here's the key to get a usable number

        IF Msgs > 1 THEN                    ' if there are more messages
            FOR j = 2 TO Msgs               ' get the offset for each
                x$ = SPACE$(5)
                GET #UX%, , x$
                conf = ASC(RIGHT$(x$, 1))
                MSoff$ = LEFT$(x$, 4)
                MSN&(j) = CVSMBF(MSoff$)
        END IF

good luck

 (( FatMail )) v0.5 - the BIG-FONT reader
 * Origin: Thunderdome - Orlando FL - (407)380-0204 - HST -> (1:363/32)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET