TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: TIM HUTZLER
from: ERIC SCHONNING
date: 1996-08-08 00:00:00
subject: Re: UNION and ather triv

TH> I am decoding QWK packets. As you may know QWK packes are constructed
TH> of 128-byte records. Each post is made up of a header record and
TH> usually one or more text records. The header record is composed
TH> several fixed length fields for which a user TYPE works very well.
TH> However the text records is essentially one continuous string.
 
Here is some code from a few years back I wrote for a friend to read
messages in QWK format.  It uses fields however, not types.  I am not
sure it even still works, as I had to extract it from the larger
program (he wanted a util to convert QWK to RBBS type message format,
but I wrote this just to make sure I was reading the QWK format
correctly).  If it doesn't work let me know and I'll try to debug
it....may need some messages in QWK format though.       Eric
 
'you need at least PB 3.00c to run this program
'program will let you read messages in QWK format
$lib all off
cls
defint a-z
open "messages.dat" as #1 len=128
field #1,128 as msgtxt$
 
open "messages.dat" as #2 len=128
field #2,1 as msgstatus$,7 as msgnum$,8 as msgdate$,5 as msgtime$,_
25 as msgto$,25 as msgfrom$,25 as msgsubj$,12 as msgpswrd$,_
8 as msgrefnum$, 6 as numblk$,1 as msgactive$,2 as msgconf$,1 as msgtag$
 
nr=lof(2)/128  '# of records
 
sp=2  'start pointer
 
do
  cls
  get #2,sp
  print "msg status: "msgstatus$
  print "msg #: "val(msgnum$)
  print "msg date: "msgdate$
  print "msg time: "msgtime$
  print "msg to: "msgto$
  print "msg from: "msgfrom$
  print "msg subj: "msgsubj$
  print "msg pw: "msgpswrd$
  print "msg ref: "val(msgrefnum$)
  print "num blk: "val(numblk$)
  print "msg conf: "cvi(msgconf$)
  print "msgtag: "msgtag$ asc(msgtag$)
 
  cnt=13
  ep=sp+val(numblk$)-1  'end pointer
  for i=sp+1 to ep
    get #1,i
    for k=1 to 128
      if mid$(msgtxt$,k,1)=chr$(227) then
        print
        incr cnt
        if cnt mod 22 = 0 then a$=input$(1):if a$=chr$(27) then exit,exit
      else
        print mid$(msgtxt$,k,1);
      end if
   next k
  next i
  print:print
  input "Get next message (y,n)? > ",a$
  if ucase$(a$)="Y" then sp=ep+1 else exit loop
loop
close
end
--- QM v1.00
---------------
* Origin: Creekside Manor (805) 484-8016 CdCom Support BBS (1:206/2512.0)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.