=========================================================================== BBS: The Abacus * HST/DS * Potterville, MI Date: 03-12-93 (10:26) Number: 34 From: CALVIN FRENCH Refer#: NONE To: GREG DINERT Recvd: NO Subj: RECKEEP part 2 Conf: (35) Quick Basi --------------------------------------------------------------------------- '>>> Start of page 2. 'considered cleaner to do it that way, though I don't 'think (don't know) just TYPEing the actual variable '(user) would work. Don't bother trying, it's always done 'this way as much as I've seen. MS does it this way, and 'they made it, so it must be right (hehe) ' DIM user AS RecordType ' 'Ok, to find the record LENgth, add up all the parts to the 'record. (hmm... 20 + 15 + 40 + 80 + 1 + 10 + 12 = 178) so 'we'll let a variable describe that for easy reference. ' RecLen = 178 ' 'Ok, we're going to ADD a record to the file, so we need to 'find out how many records already exist. The formula for that 'is: 'Number of bytes in file / lenght of one record. 'Use the LOF(1) function to find out how long file (1) is. ' NumRecs = LOF(1) / RecLen 'Reclen is 178, lenght of 1 record CurrRec = NumRecs + 1 'This sets the record counter to 1 plus 'what's already there. user.Uname = USERname$ 'We INPUTted these earlier. user.PhoneNum = UPhoneNum$ user.Address = UAddress$ user.info = Uinfo$ user.Accesslevel = Ulevel$ user.othername = Uothername$ user.password = Upassword$ ' 'This just writes 'user' and all it's data to the file. CurrRec is 'our record counter. ' PUT 1, CurrRec, user PRINT "Record written... Another (Y/N)? " key$ = INPUT$(1) 'get 1 char from the keyboard IF UCASE$(key$) = "N" THEN EXIT DO LOCATE 9, 1 PRINT " " LOOP ' 'Ok, so you chose not to enter any more records. We'll display them now. ' NumRecs = LOF(1) / RecLen SEEK 1, 1 'sets us up to read the very first record to read next CLS COLOR 11, 0 PRINT "YourBBS Record Entering service: View user records." COLOR 15, 0 PRINT PRINT "User Name | Phone Number | A | Alias | ID # "+_ " |" PRINT "--------------------+----------------+---+------------+----------"+_ "----+" DIM ReadRec AS RecordType FOR n = 1 TO NumRecs IF n MOD 10 = 1 AND n > 1 THEN 'display 20 records at a ' time PRINT "--------------------+----------------+---+------------+--"+_ "------------+" PRINT "Press a key to continue..." key$ = INPUT$(1) LOCATE 5, 1 FOR x = 1 TO 10 PRINT " | | | | "+_ " |" NEXT x LOCATE 5, 1 END IF GET 1, n, ReadRec PRINT ReadRec.Uname; "| "; ReadRec.PhoneNum; "| "; PRINT ReadRec.Accesslevel; " | "; ReadRec.othername; " | "; n NEXT n '>>> Continued on page 3. ... OFFLINE 1.39 * Benji! Watch out for that car! Whap!@#$%^& NO TERRIER --- Maximus 2.01wb * Origin: RJ's Byteline =[HST/DS]= Calgary (403)247-3180 CANADA (1:134/75) SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1 SEEN-BY: 153/752 154/40 77 157/2 159/100 125 430 950 203/23 209/209 280/1 SEEN-BY: 390/1 396/1 15 397/2 2230/100 3603/20