--------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F4300003 Date: 04/02/98 From: DAVID WILLIAMS Time: 02:54pm \/To: DAVID STUMPF (Read 3 times) Subj: Multiple eofs -> DW> In any (reasonable) DOS, EOF is *not* just an ASCII character. -> The DW> stuff that is recorded on a disk is a whole lot more complex -> than it DW> appears "through" the DOS. There are extra bits that are -> used for error DW> detection and correction. And there are codes for -> things like EOF that DW> do not represent any regular characters. The -> DOS handles everything, DW> and provides the outside world with -> something that looks a whole lot DW> simpler than what is really on -> the disk. It also ensures (or *should* DW> ensure) that there is only -> one EOF in each file, at its very end. -> DW> No? -> You can add as many EOF characters to a file as you wish. The first -> one that basic encounters, will be reported as the end of file I -> believe. (It would make sense to me at least) How do you write EOFs to a file? As I said, in every Disk Operating System with which I am familiar, EOF is *not* an ASCII character. It's one of the DOS's internal control codes, along with others that deal with the chaining of disk sectors in a file, checksums that are used to detect and correct errors, and so on. When you write a file, the DOS automatically puts one of these secret EOFs on the end. If you append to the file, the EOF that was there previously is removed, and a new one is put at the end. When a file is read, the reading automatically ends at the EOF. Since there is only one, at the end of the file, that is obviously the correct place to stop. There is no way that a user, working "through" the DOS, can stick EOFs into the middle of a file, or append stuff after the EOF without removing it, or do anything else that would lead to there being more than one EOF in a file. To do these kinds of things, you'd have to work at the machine level, sending signals to the disk drive that the DOS would never send. Sure this would be possible, if you're a clever enough programmer, but why would you want to do this?! And if you did, surely you would know how to read past these EOFs. dow --- PCBoard (R) v15.3 (OS/2) 5 * Origin: FidoNet: CAP/CANADA Support BBS : 416 287-0234 (1:250/710) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F4300004 Date: 03/30/98 From: PAT PRIDGEN Time: 05:45am \/To: DAVID AUKERMAN (Read 3 times) Subj: Code FAQ organizer? [In a message from David Aukerman to Robert Kohl ] DA> I'll go ahead and do the April FAQ, but after that you can take DA> it over. DA> Mr. Moderator, do we have official approval here? :) Sounds fine to me David. Moderator: Fidonet Quik_Bas 1:236/7, pat.pridgen@svis.org *SignIt 2.x #001* ... If it ain't broke, release a NEW version until it is! ___ Blue Wave/DOS v2.30 --- Maximus 2.02 * Origin: THE LOFT in Auburn IN 219-925-5524 & 238-3222 HST/V34+ (1:236/7) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F4300005 Date: 03/31/98 From: JOHN ZORTMAN Time: 02:00am \/To: CHRIS GUNN (Read 3 times) Subj: Re: Multiple eofs CG>Are you opening the file for BINARY? If you open a binary file for INPUT y CG>are going to run into all kinds of problems. CG>Reading a binary file one character at a time is also inefficient. GET what CG>you need in 5kb chunks instead of banging the hard drive 5 thousand times. CG>LOF to establish the size of the last GET. Why not Open for binary and A$=INPUT$(#1,32767) if you feel like it. Real fast even. You just have to determine file size in bytes ahead of time so you don't try to read past EOF. Binary ignores false EOF's and such as well. You can INPUT$ as large as you can DIM a string for in one step. Zoom... John Zortman JZ@sevenstar.com * SLMR 2.1a * I'll have what that guy on the floor is having! --- Platinum Xpress/Wildcat! v1.3e * Origin: Seventh Star - York, PA (717)-225-7256 (1:2700/111) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F4300006 Date: 04/01/98 From: JOHN ZORTMAN Time: 07:53pm \/To: ALL (Read 3 times) Subj: JZComm: FosTerm.Bas 1/2 ' JZComm: FOSSIL I/O made easy. ' Released as Copyrighted Public Domain 03-31-1998 by John Zortman. ' De Ye What Ye Will, but include my name someplace visible. :-) ' See Ralf Brown's Interrupt list for additional info on my routines. ' AnsiWrite posted by Nigel Traves in the FIDO QuickBasic conference ' as from Mark Groves. This JZComm: FosTerm _example_ requires BNU or X00 ' FOSSIL drivers easily found on just about any FIDO BBS. ' ** Tested with X00 V1.50 & BNU V2.02. ** ' These JZComm routines are the keys for easily writing your own Door Games ' or FOSSIL based terminals. BNU can be made to work with Win95. (Dos Window) ' See *important info* in part 2: JZComm: DOC. ' Lines that end with _ were split to fit conference mail and must be ' edited so next line down becomes one with it. ' Long Live BBSing! Email: JZ@sevenstar.com DEFINT A-Z ' $INCLUDE: 'qb.bi' DECLARE SUB AnsiCheck () DECLARE SUB AnsiWrite (Text$) DECLARE SUB ClearInputBuffer () DECLARE SUB CloseJZComm () DECLARE SUB DTRControl (x) DECLARE SUB KLS () DECLARE SUB OpenJZComm (Port%, Status%) DECLARE SUB RespondAnsi () DECLARE SUB RTSCTSEnable () DECLARE SUB Transmit (a$) DECLARE FUNCTION CarrierLost () DECLARE FUNCTION DataWaiting () DECLARE FUNCTION ModemStatus () DECLARE FUNCTION ReadChar () DIM SHARED Regs AS RegType DIM SHARED RegsX AS RegTypeX DIM SHARED Esc$, CRLF$, EnterKey$, i$ DIM SHARED AnsiAsk$, AnsiAnswer$, Nul$, Port% ' Key Board Definitions - - - - - - - - - - - - - - - - - - - - - - - - UpKey$ = CHR$(0) + CHR$(72): DownKey$ = CHR$(0) + CHR$(80) LeftKey$ = CHR$(0) + CHR$(75): RightKey$ = CHR$(0) + CHR$(77) EnterKey$ = CHR$(13): Esc$ = CHR$(27) AnsiUp$ = Esc$ + "[A": AnsiDown$ = Esc$ + "[B": AnsiLeft$ = Esc$ + "[D" AnsiRight$ = Esc$ + "[C": AnsiAsk$ = Esc$ + "[6n" Nul$ = CHR$(0): AsciiCLS$ = CHR$(12) CRLF$ = CHR$(13) + CHR$(10): F10Key$ = CHR$(0) + CHR$(68) ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Port% = 1 '<<******* Change this to your Modem's Com Port: 1-4 ******* KLS OpenJZComm Port%, Status% ' Speed, parity, stop bit preset by FOSSIL AnsiWrite " FOSSIL Reports:" + STR$(Status%) + CRLF$ AnsiWrite "(6484 is Correct)" + CRLF$ IF Status% <> 6484 THEN AnsiWrite STR$(Status%) + "?!": END RTSCTSEnable AnsiWrite "F10 = HangUp & Exit" + CRLF$ ClearInputBuffer Transmit "ATZ" + CRLF$: SLEEP 2 AnsiWrite "Manually enter Init string if necessary." + CRLF$ AnsiWrite "ATDTxxx-xxxx where x's are numbers to dial.." + CRLF$ AnsiWrite "You want frills, you add em'. :-)" + CRLF$ w1: IF DataWaiting THEN i$ = CHR$(ReadChar): AnsiWrite i$ a$ = INKEY$: IF a$ = "" THEN GOTO w1 if a$ = F10Key$ THEN GOTO HangUp Transmit a$ ST% = ModemStatus IF NOT ST% AND 128 THEN GOTO w1 ' Bit 7 set upon connection lp: IF DataWaiting THEN i$ = CHR$(ReadChar): IF i$ = Esc$ THEN AnsiCheck ELSE_ AnsiWrite i$ IF i$ = AsciiCLS$ THEN KLS a$ = INKEY$: IF a$ = "" THEN GOTO lp SELECT CASE a$ CASE UpKey$ ' Arrow key translation aka Lord2 etc. a$ = AnsiUp$ ' as needed for some door games CASE DownKey$ a$ = AnsiDown$ CASE LeftKey$ a$ = AnsiLeft$ CASE RightKey$ a$ = AnsiRight$ END SELECT IF a$ = F10Key$ THEN GOTO HangUp Transmit a$ GOTO lp HangUp: AnsiWrite "Hanging Up..." + CRLF$ DTRControl 0 ' This purposely pulls DTR low to cause hang up Transmit "ATH" + CRLF$ CloseJZComm ' Deinitialize port. DTR *NOT* affected by this. AnsiWrite Esc$ + "[37;40m" + Esc$ + "[0m" ' Above line returns to normal white;black colors for dos prompt ' Could add a KLS here if you wish. END SUB AnsiCheck FOR l = 2 TO 4 IF DataWaiting THEN i$ = i$ + CHR$(ReadChar) NEXT l IF RIGHT$(i$, 1) = "n" THEN RespondAnsi: GOTO LeaveAnsiCheck IF MID$(i$, 3, 1) = "=" THEN GOTO LeaveAnsiCheck ' No Graphics screens, thank you. (Use ANSI.COM to prevent key redefines) AnsiWrite i$ LeaveAnsiCheck: END SUB SUB AnsiWrite (Text$) RegsX.ax = &H4000 'AH = 40H RegsX.bx = 1 'FILE HANDLE RegsX.cx = LEN(Text$) 'Number of Bytes to Write RegsX.ds = VARSEG(Text$) 'Segment for the string 'Use SSEG(Text$) Vice VARSEG(Text$) for PDS 7.1 RegsX.dx = SADD(Text$) 'Segment offset(address) of string CALL INTERRUPTX(&H21, RegsX, RegsX) END SUB FUNCTION CarrierLost CarrierLost = 0 Regs.ax = &H300 ' Same as ModemStatus Regs.dx = Port% - 1 CALL Interrupt(&H14, Regs, Regs) AH = INT(Regs.ax / 256) AL = Regs.ax - (AH * 256) IF AL < 128 THEN CarrierLost = 1 ' If Bit 7 clear there's NO CARRIER END FUNCTION ' I.E.: IF CarrierLost THEN .... SUB ClearInputBuffer Regs.ax = &HA00 Regs.dx = Port% - 1 CALL Interrupt(&H14, Regs, Regs) END SUB SUB CloseJZComm Regs.ax = &H500 Regs.dx = Port% - 1 CALL Interrupt(&H14, Regs, Regs) ' DTR *not* affected END SUB FUNCTION DataWaiting DataWaiting = 0 ' 0 = No data Regs.ax = &HC00 Regs.dx = Port% - 1 CALL Interrupt(&H14, Regs, Regs) >>> Continued to next message * SLMR 2.1a * Sand, sand, sand, pearl, sand, sand. Almost missed it. --- Platinum Xpress/Wildcat! v1.3e * Origin: Seventh Star - York, PA (717)-225-7256 (1:2700/111) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F4300007 Date: 04/01/98 From: JOHN ZORTMAN Time: 07:53pm \/To: ALL (Read 3 times) Subj: JZComm: FosTerm.Bas 2/2 >>> Continued from previous message IF Regs.ax = &HFFFF THEN GOTO LeaveDataWaiting ' No data DataWaiting = 1 ' Yes data waiting LeaveDataWaiting: 'I.E: IF DataWaiting THEN .... END FUNCTION SUB DTRControl (x) IF x < 0 OR x > 1 THEN BEEP: GOTO LeaveDTRControl IF x = 0 THEN Regs.ax = &H600 ' Pull DTR Low (Hang up) IF x = 1 THEN Regs.ax = &H601 ' Set DTR High Regs.dx = Port% - 1 CALL Interrupt(&H14, Regs, Regs) LeaveDTRControl: END SUB SUB KLS ' If you reference screen any other way than through AnsiWrite you ' will lose your onscreen blinking cursor thereafter. ' Avoid all QuickBasic screen related commands like the plague! a$ = Esc$ + "[2J" AnsiWrite a$ END SUB FUNCTION ModemStatus Regs.ax = &H300 Regs.dx = Port% - 1 CALL Interrupt(&H14, Regs, Regs) AH = INT(Regs.ax / 256) AL = Regs.ax - (AH * 256) ModemStatus = AL END FUNCTION SUB OpenJZComm (Port%, Status%) Regs.ax = &H400 Regs.dx = Port% - 1 ' All FOSSILs see 1 as 0, 2 as 1 etc. CALL Interrupt(&H14, Regs, Regs) 'DTR is raised if not already Status% = Regs.ax END SUB FUNCTION ReadChar ' This is FOSSIL ReadChar with <<< wait >>>. ' If isn't DataWaiting checked first it will wait forever til input! Regs.ax = &H200 Regs.dx = Port% - 1 CALL Interrupt(&H14, Regs, Regs) ReadChar = Regs.ax END FUNCTION SUB RespondAnsi Regs.ax = &H300 ' Where is cursor now located? Regs.bx = &H0 ' Screen Page 0 CALL Interrupt(&H10, Regs, Regs) Row = INT(Regs.dx / 256) ' Row in DH, Col in DL Col = Regs.dx - (Row * 256) Row = Row + 1: Col = Col + 1 ' Add 1 to start with 1 instead of 0 a$ = Esc$ + "[" IF Row < 10 THEN a$ = a$ + "0" a$ = a$ + LTRIM$(RTRIM$(STR$(Row))) a$ = a$ + ";" IF Col < 10 THEN a$ = a$ + "0" a$ = a$ + LTRIM$(RTRIM$(STR$(Col))) a$ = a$ + "R" Transmit a$ + CRLF$ 'Proper ANSI response is current Row;Col location END SUB SUB RTSCTSEnable Regs.ax = &HFF2 ' No XON/XOFF. AL Bit pattern is for RTS/CTS handshake. Regs.dx = Port% - 1 CALL Interrupt(&H14, Regs, Regs) END SUB SUB Transmit (a$) ' This line could check if Port%=0 its in LOCAL mode goto LeaveTransmit RegsX.ax = &H1900 ' Send block of data RegsX.dx = Port% - 1 RegsX.cx = LEN(a$) RegsX.es = VARSEG(a$) ' Easy to figure out RegsX.di = SADD(a$) CALL INTERRUPTX(&H14, RegsX, RegsX) IF RegsX.ax < LEN(a$) THEN BEEP ' See CarrierLost FUNCTION. LeaveTransmit: ' Label to jump to if used in a door playable in local mode END SUB ' - - - - - End Of FOSTERM.BAS - - - - CUT HERE - - - - - John Zortman JZ@sevenstar.com * SLMR 2.1a * Sand, sand, sand, pearl, sand, sand. Almost missed it. --- Platinum Xpress/Wildcat! v1.3e * Origin: Seventh Star - York, PA (717)-225-7256 (1:2700/111) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F4300008 Date: 04/01/98 From: JOHN ZORTMAN Time: 07:42pm \/To: ALL (Read 3 times) Subj: JZComm: Docs QuickBasic 4.5.... NOTE: Depending on your system's speed, you'll need to COMPILE FosTerm into a stand alone EXE so it can keep up with speedy modems. FosTerm is only a simple example program. My JZComm: SUBs and FUNCTIONS are what you need for writing Doors that are stable on any system running X00 or BNU. Tested with X00 V1.50 and BNU V2.02. Available everywhere. Many many Sysops already run these, at least for certain Doors, and those that don't will quickly find they're easy to set up in a number of different ways, one of which will be workable for their set up. My sysop, Fred Strausbaugh, of Seventh Star BBS here in York, Pa., runs a WildCat! FIDO HUB that is multinode with a satellite feed and all kinds of stuff, easily bounced between X00 and BNU and straight internal routines in the course of the last month, all just for testing and hasn't missed a beat with the mail either. :-) I.E.: Many knowledgable Sysops have no worries with these FOSSIL drivers. Those that have questions should be able to find help from any number of other Sysops out there in FIDO land and elsewhwere... Ok, first off, DTR is not affected by CloseJZComm. So in a door situation DTR is high to begin with from BBS, OpenJZComm which would otherwise raise it has no effect when its already raised, and again, CloseJZComm does not have any effect on DTR. You be door game ready. There is no need to patch QuickBasic 4.5 to avoid DTR being pulled low because it just doesn't happen this way. (Unless you purposely issue a DTRControl 0). This has all been tested, as in my Kings In The Corner door now running on Seventh Star BBS. Between X00 and BNU, BNU is the easiest to set up, because with X00 you'll need to add some X00 specific commands prior to running things this way. No big deal with batch files but.... My understanding *was* that only BNU will get along with Win95, but I recently was told somebody got X00 to play with Win95. I dunno, haven't tried it. Like many here I do not like Win95, don't run it. But BNU is known to work with it so that means your door games will too in a dos window. As more BBS's go Win95 thats kind of important. Understatement. Following BNU examples are with modem on COM1. bnu /l:0=11520,8N1 /x /z0 /f bnu /s This loads BNU as a TSR and LOCKS Com port 1 (0 to FOSSIL) to 115200 with 8 data bits, No parity, 1 stop bit. The other switches are in the docs and easy to understand and such. The *important* point is LOCKING the port here. BNU /S shows details of whats up. The 11520 is NOT a mistype. Its an undocumented feature to go 115200. Sysops Add for additional nodes. You be all done loading BNU... Following for loading X00 instead. This one is more picky. Before anything rename X00.SYS to X00.EXE to run it TSR style. Then: X00 e t=1024 r=1024 fifo=15 XU LOCK:0:115200:8N1 This installs X00 and locks Com1 (0 to Fossil) @ 115200 as above. Right before loading and running a door, you have to: XU SET:0:115200:8N1 to set the port to that and XU PORT:0:ON to make it go active immediately before loading door (or FosTerm.exe) Sysops Add for additional nodes and thats it. And that my friends, is the bare essentials needed to installing a FOSSIL. The doc.s include lots of info about CONFIG.SYS and multitasking and all kinds of things, but for testing purposes the above gets me by for writing/testing stuff that uses FOSSIL drivers. Adjust Com port and speed as necessary and read the docs carefully. You're not going to write doors without reading some docs. If you look back a month or so in the FIDO QuickBasic conference you'll find my SUBs and such I'd written utilizing AnsiWrite for KLS, Kolor, Lokate, and etc. routines to make ANSI I/O for door games a breeze. See the ' notes in Transmit for running in Local mode and programming really gets easier. Just remember if you use so much as one (1) QuickBasic command that references the screen, the blinking cursor will disappear and stay gone. This is because QB will be waiting for somebody to tell it what to to with "its" screen and won't show the cursor until that happens. All screen output must be thru AnsiWrite from start to END. This is not as hard as it might sound. CarrierLost is included in but not used by the simple FosTerm example program. CarrierLost returns a 1 if CarrierLost, 0 if online. This is for careful checking in case of NO CARRIER. I.E.: IF CarrierLost THEN ..some action to handle this (GOTO or whatever) so your program will safely and quickly exit back to BBS if somebody hangs up or gets disconnected or whatever. Use liberally in the right places throughout your programs where it waits for input and such. BBSing is an important aspect of a legitimate part of life around the world. The internet can kill BBSing like TV can kill the radio. *Ain't gonna happen* FosTerm has all the FOSSIL I/O SUBs and FUNCTIONs you need to write Door programs and utilities that will work on anybody's system. These FOSSILs such as BNU will extend your work into the age of Win95 so its no longer such an enemy to us Dos experienced programmers. FIDO and BBSing as a whole will hopefully benefit from this being freely known and available for some time yet to come. Again all I'm asking is you remember to include my name in the credits somewhere if you use this stuff and you're happy with it. What you write is completely your own. There are plenty of bright young minds out there that could really use these tested, working routines. Do the BBSing world a favor and help pass them along! More is better. I don't mind the "competition". :-) Please let me know if you use my JZComm: routines. These required plenty of study time and testing to be sure they were solid, and it'd be nice to hear from those freely using them. Also keep an eye open for our Door games and such as we release them from Seventh Star as low cost ShareWare. (I could use the money )... Have A Good One! John Zortman JZ@sevenstar.com * SLMR 2.1a * Death is just God's way of dropping Carrier. --- Platinum Xpress/Wildcat! v1.3e * Origin: Seventh Star - York, PA (717)-225-7256 (1:2700/111) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F4300009 Date: 04/02/98 From: BILL WHITE Time: 12:00am \/To: TYS ARMSTRONG (Read 3 times) Subj: Qbasic TA> Could anyone give me the basic commands for QBASIC. Also I need to TA> nmake a high scores and questionare. Any help? BASIC commands can be seen and studied by pressing F1 or Shift-F1. If you have an array of scores, you can easily find a maximum and minimum with: min = 10^38 'a ridiculously high number for i = 1 to top if Score(i) > max THEN max = Score(i) if Score(i) < min THEN min = Score(i) next i As to a questionnaire, a simple form: line input "Please enter your name: "; YourName$ line input "Sex: "; Sex$ Then you can get fancy. Like testing that the person answers "male" or "female", rather than "yes" or "as often as possible"! Our club's BBS, for example, has a questionnaire for new users. If they don't enter anything for their phone number, or enter 555-anything or 111-1111, stuff like that, it places them in TWIT status and severely limits their access and use. The guy who set this board up didn't set it so it hung up on idiot callers; instead it asks them even more questions without recording the answers, runs them around in circles, and generally tries to play with their minds. Usually, they hang up in disgust before it does! If they call back with the same name, they get a further run-around. FIDO: Bill White @ 1:135/110 (Miami) InterNet: bill.white@110.sunshine.com * SLMR 2.1a * Line noise provided by Southern Bell - no extra charge! --- Maximus 2.01wb * Origin: Miami Amateur Computer Club BBS/USR Courier V.E (1:135/110) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F4300010 Date: 04/02/98 From: JOHN ZORTMAN Time: 04:13pm \/To: ALL (Read 3 times) Subj: KEYBOARD.BAS Mix an old Basic/Assembly programmer, QuickBasic 4.5, and Ralf Brown's Interrupt list, and you get a bunch of odd bits and pieces type posts like this one... All this does is allow you to alter the time it takes (delay) after you hold down a key for it to start repeating, and to alter how fast it then repeats. I find I like Delay=1 as thats about 1/2 second, and Rate=0 for maximum speed, because then as I type and edit and such in QuickBasic or SLMR or etc., I can really zip around with those arrow keys! Once you set this you can exit and run other programs and unless you reset the machine (or go into Windows? Didn't test) or whatever, your new keyboard Delay / repeat Rate settings stay in effect. No big deal but it sure speeds up arrow keying around. :-) In case anyone wants the SUBs here they be... ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DEFINT A-Z ' $INCLUDE: 'qb.bi' DIM SHARED Regs AS RegType DECLARE SUB GetKeyBoard (Rate, Delay) DECLARE SUB SetKeyBoard (Rate, Delay) F10Key$ = CHR$(0) + CHR$(68) lp: CLS GetKeyBoard Rate, Delay PRINT "Delay="; Delay; " (0=250ms to 3=1000ms)" PRINT "Rate="; Rate; " (0=30cps to 12=10cps [default] to 31=2cps)" INPUT "Enter New Repeat Delay:"; Delay INPUT "Enter New Repeat Rate:"; Rate SetKeyBoard Rate, Delay PRINT " Type a bit to test, F10 to change settings, Esc to exit" lp2: a$ = INKEY$: IF a$ = "" THEN GOTO lp2 IF a$ = F10Key$ THEN GOTO lp IF a$ = CHR$(27) THEN END PRINT a$; GOTO lp2: SUB GetKeyBoard (Rate, Delay) Regs.ax = &H306 CALL Interrupt(&H16, Regs, Regs) BH = INT(Regs.bx / 256): BL = Regs.bx - (256 * BH) Delay = BH: Rate = BL END SUB SUB SetKeyBoard (Rate, Delay) Regs.ax = &H305 Regs.bx = (Delay * 256) + Rate CALL Interrupt(&H16, Regs, Regs) SKeyBoard: END SUB ' - - - - - - End of KeyBoard.Bas - - - - - Cut Here - - - - - - - - John Zortman JZ@sevenstar.com * SLMR 2.1a * Reality is for people who can't handle computers. --- Platinum Xpress/Wildcat! v1.3e * Origin: Seventh Star - York, PA (717)-225-7256 (1:2700/111) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F4400000 Date: 04/02/98 From: CHRIS GUNN Time: 12:43am \/To: DAVID WILLIAMS (Read 3 times) Subj: Re: Multiple eofs DW> In any (reasonable) DOS, EOF is *not* just an ASCII character. The DW> stuff that is recorded on a disk is a whole lot more complex than it DW> appears "through" the DOS. There are extra bits that are used for DW> error detection and correction. Howdy David, Mostly right! Most of the file heading entries you are referring to happen for *.COM and *.EXE files. The parity codes are a function of the disk drive and the DOS kernel and are not accessable unless you directly read sectors from the disk. I used to do that stuff way back {grin}. The End-Of-File character CHR$(26) is a left over from CP/M and early DOS programs. QuickBasic tries to stay compatible by observing it for text based files. Some programs still put an EOF character at the end of text files. Most newer programs do not. They go by the length stored in the directory entry for the file. The EOF character is ignored when opening a file for BINARY or RANDOM. If CHR$(26) and some other lower 32 control codes appear inside a file, it's not intended for sequential text access by opening the file for INPUT. Chris --- FMail 0.96 * Origin: BIZynet - Worldwide Business via the E-Ways (1:15/55.1) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F4400001 Date: 04/02/98 From: BRUCE CORBETT Time: 11:49am \/To: DAVID WILLIAMS (Read 3 times) Subj: Multiple eofs Hi David Williams, hope you are having a nice day .+'~'+. | Qouted from a message from David Williams 31-Mar-98| To David Rothschild `+._.+' | About Multiple eofs ->> How do I read/write files with multiple EOF's (like ZIPs or EXEs)? ->> I'm writing an Encryption program, but it stops at the first EOF. I ->> tried a FOR X = 1 to LOF..... but then I ran into an "Input past end ->> of file", even when there was more file past the EOF. DW> Forgive a "mere" Mac user, but how can a file have more than one EOF? Forgive me for reading my QB Help file but..... DW> In any (reasonable) DOS, EOF is *not* just an ASCII character. The stuff DW> that is recorded on a disk is a whole lot more complex than it appears DW> "through" the DOS. There are extra bits that are used for error Acording to the ASCII chart there is a char going by the ascii number 26 that is counted to be the eof flag.....You may want to look at the chart by going to the 'contents' then 'ASCII character Codes'.... You are correct in some of your message when you say that DOS controls error correction but not eofs.... If you try opening a data file made in Pascel you will notice that any string that has 26 chars in it starts with an EOF. And a word of note: If you ever do read in a file DOS will always give at least one EOF....But it may also give 10 Depending on the type of file. Sorry for the moan but i'll set you up for the rest of the moans youll get for this. .+'~'+. | Bruce Corbett (Hook@Cheerful.com) H O O K | Hk Software (www.members.tripod/~nzhook) `+._.+' | ruce's anter S (3:775/70) ((646) 756-6331 Np, Nz) --- * Origin: Hk Software (3:775/70)