qwk help

 BBS: Inland Empire Archive
Date: 10-20-92 (21:22)             Number: 290
From: JEFFERY FOY                  Refer#: NONE
  To: JOHN GALLAS                   Recvd: NO  
Subj: qwk help                       Conf: (2) Quik_Bas
 -=> Quoting John Gallas to All <=-

 JG> I'm working on writing a little qwk reader.  I've got alotta docs
 JG> about the qwk format, and I was able to make a program that'd go
 JG> through the messages.dat file and print out all the messages, but I
 JG> want to be ablt to go through the file conference by conference, and
 JG> in order to do that, I'll have to use the .NDX files.

That isn't true. The only thing the .NDX files do is make it easier to
access the actual message text. Using the control.dat and messages.dat
files alone, you could make yourself a nice little reader. (slower than
the others but usable :)

 JG> The problem is, the single integer <the first 4 bytes per record>
 JG> returns some number in the negative billions!

The first four bytes of each record (each record being 5 bytes) is a
*floating point* number in MSBIN (aka MKS$) format. In QB45 and PDS 7.1,
use the CVSMBF function to convert that value to a more useful value.
Here's an example:

   X$ = SPACE$(5)                    ' set aside five bytes
   GET #2, ,X$                       ' get a record from the file
                                     '  (set as #2 here)
   WHERE$ = LEFT$(X$,4)              ' pick out the value we want
   OFFSET = CVSMBF(WHERE$)           ' convert the value to IEEE
                                     '  format

After the conversion, the variable OFFSET is the SEEKable position in
the file MESSAGES.DAT where this message starts. Simple and clear,
right. :)


... In /dev/null, no one can hear you scream.
--- Blue Wave/RA v2.10 [NR]
 * Origin: Crystal Cavern, Kent, WA <206>850-0439 (1:343/105.0)
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