--------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F3300006 Date: 02/25/98 From: TERRY MUELLER Time: 10:32am \/To: JOHN ZORTMAN (Read 3 times) Subj: Re: QB.BI JZ> Could somebody please save me tons of work and post JZ> the QB.BI here as a message? You will have to get it from the disks that you received when you bought QuickBasic. QB.BI is copyrighted by MicroSoft; and, as such, it would be illegal for anyone to post it here. Sorry about that. --- Sirius 1.0ya * Origin: Boeing Employees Rec. Computer Club (314-830-4287) (1:100/10) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F3300007 Date: 02/25/98 From: TED CRAMER Time: 09:13pm \/To: KURT KUZBA (Read 3 times) Subj: create a file KK-> This doesn't address your case specifically, but see if it gives KK-> you any ideas. '_|_|_| FINDTEXT.BAS '_|_|_| This program performs KK-> a fast file search for any given '_|_|_| text, selectively KK-> allowing case sensitivity. '_|_|_| Full overlapping is implemented This looks good .... I think I can alter it to fit my particular needs. Thanks!! --- Ted's Castle * Origin: Ted's Castle / (216) 671-1057 (1:157/574) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F3300008 Date: 02/23/98 From: PAT PRIDGEN Time: 06:41am \/To: DOUGLAS LUSHER (Read 3 times) Subj: File Viewer & Editor [In a message from Douglas Lusher to Robert Carlson ] Hi Douglas, DL> I have written a small text editor completely in QB45. The code was DL> uploaded and posted on Joe Negron's board. I don't know if Pat has DL> it or not - it's a little bit too much to post here. If you find it, I've been looking for it, but..it may have been lost in a HD crash. I'll have to check floppies. I'm suspicious that it is long gone though. Nice to see you posting again. . pat.pridgen@svis.org . La Grande, Oregon *SignIt 2.x #001* ... "Bother," said Pooh, noticing he'd deleted his source code. ___ 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: F3300009 Date: 02/25/98 From: ROBERT FORTUNE Time: 11:52am \/To: GARY TYLER (Read 3 times) Subj: Opening a COM port 1/2 GT> Please Do, I have for years wanted to be able to write programs GT> for my bbs in QBASIC. My BIOS interrupt 14H program needs more work and if you are using only QBASIC you can't call interrupts. For that you need QuickBASIC 4.5. Here's a comm program for calling a BBS that uses OPEN but works okay (so far). It's a work in progress. You'll get it in 2 parts and will have to put it back together into a single program before running it. It should run in QBASIC as it does not call any interrupts. ' ----------- CUT HERE ------------------------ CUT HERE ----------------- REM * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * REM SERIAL.BAS REM Jan 25, 1998 REM A demo QB communications program for calling a BBS. REM REM * THIS PROGRAM SHOULD BE COMPILED & LINKED FROM THE DOS COMMAND LINE! * REM REM Example: REM REM BC SERIAL/C:4096/O; REM LINK SERIAL REM REM This program currently has NO support for ANSI or RIP (ASCII only). REM * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * DEFINT A-Z ' All untyped variables will now default to type integer DECLARE SUB Filter (InString$) DECLARE SUB GetModemOK () DECLARE SUB MainScreen () DECLARE SUB SetNewBPS (BPS&) DECLARE SUB StatusLine () DECLARE FUNCTION BasePort% () DECLARE FUNCTION Carrier% () REM Declare and define variables DIM SHARED CR$, BaseAddr% ' Make these variables global in scope DIM SHARED ComPort%, ModemInData$ ' "" BackSpace$ = CHR$(8) ' ASCII Back Space control character LineFeed$ = CHR$(10) ' ASCII Line Feed control character CR$ = CHR$(13) ' ASCII Carriage Return [ENTER] CRLF$ = CR$ + LineFeed$ ' ASCII Carriage Return and Linefeed ctrl char ESC$ = CHR$(27) ' ASCII ESC key code Quit$ = CHR$(0) + CHR$(16) ' Value returned when ALT+q is pressed. ComPort% = 2 ' Active com port to use BaseAddr% = BasePort% ' Get memory I/O address of active comport REM Construct serial port data frame (8 Data bits,No parity & 1 stop bit) DataBits% = 8 ' Data bits could be 5, 6, 7 or 8 Parity$ = "N" ' (N)o parity StopBits% = 1 ' One Stop bit BPS$ = "9600" ' Open com port at QB's reliable max Bits Per Second speed GOSUB BuildComParms ' Concatenate com port parameters string FileNum% = FREEFILE ' Get next free file handle OPEN ModemParms$ FOR RANDOM AS #FileNum% ' Open the comport REM Prepare to bump up the BPS speed BPS& = 14400 ' Select a higher (than 9600 BPS) Bits Per Second speed SetNewBPS BPS& ' Now bump up Bits Per Second BPS$ = LTRIM$(STR$(BPS&)) ' Updated BPS speed GOSUB BuildComParms ' Concatenate updated com port parameters string CALL StatusLine ' Display a [local screen only] status line CALL MainScreen ' Display our program title, etc... PRINT #FileNum%, "AT&C1&D2X4" ' Put your modem init string here GetModemOK ' Wait for OK response from modem LINE INPUT "Enter the BBS number to call (XXX-XXXX): "; PhoneNum$ REM Use ATDT for touchtone phone line or ATDP for a pulse phone line PRINT #FileNum%, "ATDT" + PhoneNum$ ' Now make the call! REM * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * REM * Main Program Loop begins here * REM * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * DO KeyIn$ = INKEY$ ' Check the [local] keyboard for input. IF KeyIn$ = Quit$ THEN ' Local user pressed ALT+q? EXIT DO ' Exit the loop if the user pressed ALT+q ELSEIF KeyIn$ <> "" THEN ' Otherwise, if local user has pressed a key IF Carrier% THEN ' and we still have a remote Carrier, PRINT #FileNum%, KeyIn$; ' send the character typed to the com port. END IF END IF IF NOT EOF(FileNum%) THEN ' Data waiting at com port? DO ModemData$ = INPUT$(LOC(FileNum%), FileNum%) ' Get the data Filter ModemData$ ' Remove unwanted control character(s) PRINT ModemData$; ' Displaying incoming data on local screen LOOP WHILE NOT EOF(FileNum%) END IF LOOP REM * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * REM All done. Now we hang up the line and shut down the com port PRINT PRINT #FileNum%, "ATH0" ' Hang up the line GetModemOK ' Wait for OK response from the modem CLOSE #FileNum% ' Close the open com port COLOR 7, 0, 0 ' Reset screen colors to drab white on black END ' The End. (of main program) BuildComParms: ModemParms$ = "COM" + LTRIM$(STR$(ComPort%)) + ":" + BPS$ ModemParms$ = ModemParms$ + "," + Parity$ + "," + LTRIM$(STR$(DataBits%)) ModemParms$ = ModemParms$ + "," + LTRIM$(STR$(StopBits%)) ModemParms$ = ModemParms$ + RB$ + TB$ RETURN 'The following routine will get the correct base port address for 'Com ports 1,2,3 or 4 from BIOS Data Area where BIOS stores them on bootup. ' 'IMPORTANT NOTE: 'If you use this routine to get the base port address do it BEFORE 'opening the Com port with the OPEN COM statement as BASIC will erase 'the memory cells that contain the base port address for any Com port 'it opens. ' FUNCTION BasePort% a% = ((ComPort% - 1) MOD 4) * 2 ' ComPort% can be 1 thru 4 DEF SEG = &H40 ' Switch to BIOS DATA AREA segment BasePort% = (PEEK(a%) + (PEEK(a% + 1) * 256)) ' Read the base address DEF SEG ' Switch back to QB's default DGROUP data segment END FUNCTION REM Returns Carrier true (-1) if bit 7 of of the UART's modem REM status register is set or false (0) is bet set is not set. REM REM Uses: BasePort FUNCTION to get com port's I/O memory address REM REM Example use: REM IF NOT Carrier% THEN REM PRINT "* WARNING * Carrier lost!" REM Do whatever to allow your program to handle a dropped carrier REM END IF REM >>> Continued to next message * OLX 2.1 TD * "I knew him long before he ever became a Jersey girl." --- PCBoard (R) v15.3/M 10 * Origin: MoonDog BBS Brooklyn,NY 718 692-2498 (1:278/230) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F3300010 Date: 02/25/98 From: ROBERT FORTUNE Time: 11:52am \/To: GARY TYLER (Read 3 times) Subj: Opening a COM port 2/2 >>> Continued from previous message FUNCTION Carrier% MSR% = INP(BaseAddr% + 6) ' Get MSR (Modem Status Register) IF MSR% AND &H80 THEN ' Bit 7 set? Carrier% = -1 ' Yes so we have a carrier ELSE Carrier% = 0 ' We have NO CARRIER END IF OUT BaseAddr% + 6, MSR% ' Restore MSR END FUNCTION REM Filters out backspace and line feed characters in an input string SUB Filter (ModemData$) STATIC SHARED BackSpace$, LineFeed$, CR$ REM Look for backspace characters and remove any found BS% = 0 ' Assume no Back Space character(s) in the string CR% = 0 ' Assume no Carriage Returns in the string LnFd% = 0 ' Assume no Line Feed character(s) in the string BS% = INSTR(ModemData$, BackSpace$) DO WHILE BS% MID$(ModemData$, BS%) = CHR$(29) BS% = INSTR(ModemData$, BackSpace$) LOOP REM Look for line feed characters and remove any found LnFd% = INSTR(ModemData$, LineFeed$) DO WHILE LnFd% ModemData$ = LEFT$(ModemData$, LnFd% - 1) + MID$(ModemData$, LnFd% + 1) LnFd% = INSTR(ModemData$, LineFeed$) LOOP END SUB REM Waits for an OK response from the modem when the modem is issued REM a command (acknowlegement from the modem that the command was executed). SUB GetModemOK SHARED FileNum% ' Shared with main program module Ok% = 0 ' Preset flag to not ok FOR I% = 1 TO 2 ' Do 2 times (to be certain) In$ = "" ' Init com incoming data string Start& = TIMER ' Remember start time DO ' Modem response loop IF NOT EOF(FileNum%) THEN ' If any chars in com buffer In$ = In$ + INPUT$(LOC(FileNum%), FileNum%) ' Get incoming data Filter In$ IF INSTR(In$, "OK") THEN ' If modem responds "OK" then PRINT In$ Ok% = -1 ' Set flag Ok true EXIT DO ' Exit modem response loop END IF END IF LOOP WHILE TIMER - Start& < 72 ' Wait for "OK" for 4 seconds (approx) IF Ok% THEN EXIT FOR ' If Ok then done, so exit NEXT I% END SUB REM Displays a program title on the main screen SUB MainScreen COLOR 15 ' Bright white text (on black) VIEW PRINT 1 TO 22 ' Print text only between lines 1 & 21. Text$ = "<<< QB COMMUNICATIONS DEMO >>>" X% = 2 Y% = 39 - LEN(Text$) \ 2 ' calcs centered Text$ position on screen LOCATE X%, Y% PRINT Text$ PRINT PRINT END SUB REM This routine bumps up the BPS (Bits Per Second) rate to the value REM in the BPS& long integer variable that is passed to this routine. SUB SetNewBPS (BPS&) IF BPS& >= 1200 THEN ' BPS of at least 1200 BPS BaudDiv% = 115200 \ BPS& ' Calculate the baud rate divisor LCR% = INP(BaseAddr% + 3) ' Get & Store Line Control Register OUT BaseAddr% + 3, LCR% OR &H80 ' Set DLAB (Divisor Latch Access Bit) OUT BaseAddr%, BaudDiv% AND &HFF ' Set Low byte of new baud rate divsr OUT BaseAddr% + 1, BaudDiv% \ 256 ' Set High byte of new baud rate divsr OUT BaseAddr% + 3, LCR% ' Restore LCR END IF END SUB REM Displays a program status line on screen line 24 SUB StatusLine SHARED ModemParms$ ' Shared with main program module COLOR 2, 0, 0 ' Green text on black background CLS REM Display status bar on line 24 of local screen LOCATE 23, 1, 1 PRINT STRING$(80, "_"); COLOR 15 ' Bright white text (on black) LOCATE 24, 1 PRINT TAB(2); "Press ALT+q to quit "; PRINT ModemParms$; END SUB ' ----------- CUT HERE ------------------------ CUT HERE ----------------- - Robert Fortune * OLX 2.1 TD * "I knew him long before he ever became a Jersey girl." --- PCBoard (R) v15.3/M 10 * Origin: MoonDog BBS Brooklyn,NY 718 692-2498 (1:278/230) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F3300011 Date: 02/25/98 From: JOHN ZORTMAN Time: 06:06pm \/To: PAUL ROBINSON (Read 3 times) Subj: input PR>but when it comes to this line PR>input #1, rec$ PR>it waits for input but cant get one and just hangs there forever First off, INPUT will wait for the CRLF (Carriage Return/LineFeed) and that means wait forever in your case, second off, its obviously going to try get input when you're not sure if theres going to be any. Revamp everything and get characters one at a time. Look up INPUT$. For example: A$=INPUT$(1, #1) Would cause it to get 1 character from channel 1. A$=INPUT$(5, #1) would cause it to try for 5 characters, from channel 1, while: A$=INPUT$(1024, #69) would try to get 1024 characters (1k) from channel 69. Next, don't forget EOF(channel number). If you don't want to get stuck waiting for input that never arrives use something like: IF NOT EOF(1) THEN A$=INPUT$(1, #1) to get characters, 1 at a time, from channel 1, ONLY when there are any characters waiting to be gotten, so to speak. Put this in a loop along with an i$=inkey$ in there somewhere and you have the beginnings of an online chat terminal, checking for both keyboard and modem input. See what I mean? Don't fool around though, and get a ShareWare version of QBSerial. It is a library for QB that handles the modem for you. You use an OpenComm command as apposed to OPEN, which means you get away from the 19200 port speed limit that QB sticks you with. Second, you can OpenComm and CloseComm with out changing the DTR line, which means you can write BBS Doors with it. If you CLOSE in QB it hangs up the modem. That means you cannot write DOORS without QBSerial (or similar). QBSerial also works easily with FOSSIL drivers that some BBS's use. I could go on. Just get QBSerial and read the DOCs, you'll be glad you did... (Jeez, I don't even know the guy that wrote QBSerial and I'm sounding like a commercial or something..:-)) Have A good One! John Zortman JZ@sevenstar.com * SLMR 2.1a * Meaning of Life: --- Platinum Xpress/Wildcat! v1.3 * Origin: Seventh Star - York, PA (717)-225-7256 (1:2700/111) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F3300012 Date: 02/25/98 From: JOHN ZORTMAN Time: 06:06pm \/To: ALL (Read 3 times) Subj: Finding the cursor Hi All! However I want to go about letting ANSI.SYS handle the interpreting and screen handling of ANSI code, I end up with the same problem. This is for that real short ANSI capable MiniTerminal I'd posted here awhile back. row=CSRLIN:col=POS(0) can normally be happily used to locate the location of the cursor. However, it only returns the last location QB put it before ANSI takes it and zooms it all over doing its thing. I can open an ANSI picture file, read it into a string, and print it out to a channel opened to CONS: so the BIOS with ANSI.SYS takes it and displays it properly and such, which of course doesn't update QB's cursor at all. For simple picture displays thats no big deal. For an online terminal, however, this leaves me no way to simulate a blinking cursor onscreen, mainly because I have no way of knowing where that cursor is supposed to be. The above obviously don't cut it. What I'm sincerely hoping is, someone around here is aware of some quick and simple way I can PEEK at some memory locations or somehow easily determine where the BIOS/ANSI thinks the cursor is. If I could read this somehow then I could combine that info with the LOCATE command, and I'd have a way to keep "my" cursor right up to date with the "real" one that the BIOS/ANSI is using. Since I'd be reading from the modem character by character, I can then "feed" the data to BIOS/ANSI character by character, and update my blinking underline character cursor location, in between each one, all without mussing up the ANSI pictures or ANSI cursor control movements. I hope. At least thats what I'd like to experiment with, anyhow. How or where do I PEEK or otherwise obtain the BIOS's idea of where it's cursor is? That probably simple piece of information is stopping me cold... Thanks, John Zortman * SLMR 2.1a * Televangelists: The Pro Wrestlers of religion. --- Platinum Xpress/Wildcat! v1.3 * Origin: Seventh Star - York, PA (717)-225-7256 (1:2700/111) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F3300013 Date: 02/26/98 From: KURT KUZBA Time: 07:43am \/To: CHRIS WILSON (Read 3 times) Subj: Opening a COM port in QBA CW> I have a BBS and a Basic Compiler.. I'd like to put my CW> basic programs on my BBS.. CW> Does anybody know how to open COM 3 and make the program CW> work on a BBS!? You should look for EasyDoor or DoorFrame or some other Door construction software package. > ] Sometimes... That is all there is........................... --- * Origin: *YOPS ]I[* 8.4 GIG * RA/FD/FE * Milwaukee, WI (1:154/750)