--------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F2V00005 Date: 02/25/98 From: KURT KUZBA Time: 09:28am \/To: RICHARD MCCONNELL (Read 3 times) Subj: add text RM> What I want to do is this, I want an input to loop until RM> it has done this so many times, like 15 say. And then RM> print something else in the file it is wring to.... RM> I don't know if this makes any sense to you but I hope it RM> will.......... One thing you will learn as a programmer is that if you can clearly frame the question, it will contain the answer. If you mean to add a different bit of text to a specific line, or to only add that text to specific lines, then all you need to do is define your goals clearly, and then translate to BASIC language. Given the statement: "I want to count 15 lines of input, and then add a particular string to that line, and then finish writing the file and then exit." You would construct just such a program: LCount% = 0 WHILE NOT EOF(InFile%) LINE INPUT #InFile%, Text$ LCount% = LCount% + 1 IF LCount% = 15 THEN Text$ = Text$ + AddStr$ PRINT #OutFile%, Text$ WEND Defining your needs and your goals actually resolves them. :) --- > ] Being in the moment is all that there is.................... --- * Origin: *YOPS ]I[* 8.4 GIG * RA/FD/FE * Milwaukee, WI (1:154/750) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F2V00006 Date: 02/25/98 From: KURT KUZBA Time: 09:28am \/To: SHANE DAY (Read 3 times) Subj: Project SD> I have an Ansi Drawn, I want to store the character of SD> the x,y co-ordinate and the color attribute before I move SD> on to it but when I move off to restore the character SD> with the colour attribute, any suggestions? You could try something like this: '_|_|_| KEYCMD.BAS '_|_|_| Demonstrates of keyboard array and dynamic screen control '_|_|_| in Quick Basic. Keyboard routine of limited value - ASM. '_|_|_| No warrantee or guarantee is given or implied. '_|_|_| Released to PUBLIC DOMAIN by Kurt Kuzba. (8/2/96) DECLARE SUB Keyboard () DECLARE FUNCTION noise% () DIM SHARED Keys(128) AS INTEGER, dla AS INTEGER DIM SHARED siren AS INTEGER, sirendirection AS INTEGER COLOR 15, 1: CLS : siren = 480 PRINT " Use cursor keys to move. ESC exits." PRINT " The ALT and CTRL key make sounds." dla = 0: DEF SEG = &H40: t% = PEEK(&H6C) WHILE t% = PEEK(&H6C): WEND: t% = PEEK(&H6C) WHILE t% = PEEK(&H6C): dla = dla + 1: WEND: t% = PEEK(&H6C) dla = dla \ 50 COLOR 14: underchar% = 32: undercolor% = 16 x% = 12: y% = 40: c$ = CHR$(219): LOCATE x%, y%: PRINT c$; DO IF Keys(1) > 0 THEN EXIT DO: ELSE Keyboard ox% = x%: oy% = y% IF (Keys(72) > 0) AND (x% > 1) THEN x% = x% - 1 IF (Keys(75) > 0) AND (y% > 1) THEN y% = y% - 1 IF (Keys(77) > 0) AND (y% < 80) THEN y% = y% + 1 IF (Keys(80) > 0) AND (x% < 25) THEN x% = x% + 1 IF (ox% <> x%) OR (oy% <> y%) THEN t% = 0: WHILE t% < dla: t% = t% + noise%: WEND DEF SEG = &HB800: p% = ((ox% * 80 + oy%) - 81) * 2 POKE p%, underchar%: POKE p% + 1, undercolor% p% = ((x% * 80 + y%) - 81) * 2 underchar% = PEEK(p%): undercolor% = PEEK(p% + 1) LOCATE x%, y%: PRINT c$; ELSE toss% = noise% END IF LOOP: DEF SEG = &H40: POKE &H17, PEEK(&H17) AND 240 SUB Keyboard K% = INP(96): Keys(K% AND 127) = 1 + (K% > 127) toss$ = INKEY$ END SUB FUNCTION noise% STATIC zap% result% = 1 IF Keys(29) > 0 THEN IF siren < 500 THEN sirendirection = 20: Keyboard IF siren > 1000 THEN sirendirection = -20: Keyboard siren = siren + sirendirection: SOUND siren, .07: Keyboard result% = result% + dla * .3: Keyboard END IF: Keyboard IF Keys(56) > 0 THEN zap% = (zap% MOD 1000) + 100: SOUND zap%, .03: Keyboard SOUND 1200 - zap%, .03: Keyboard result% = result% + dla * .2: Keyboard END IF: Keyboard: noise% = result% END FUNCTION '_|_|_| end KEYCMD.BAS > ] Redundancy: Playing "Battle of Evermore" during housework... --- * Origin: *YOPS ]I[* 8.4 GIG * RA/FD/FE * Milwaukee, WI (1:154/750) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F2V00007 Date: 02/25/98 From: KURT KUZBA Time: 09:28am \/To: TIKA CARR (Read 3 times) Subj: File viewer & editor TC> ask him for KISSED.BAS. TC> Kurt? you listening? Time for another repost. ;) I could do that... I should take a little time and finish LLED.BAS It is a Linked List EDitor for QB45. The list uses indices versus pointers, since QB45 does not support pointers, but it allows for a few thousand lines of text and multiple documents quite nicely. All it really needs is a few bugs knocked out of it, and then the load, save, and configuration routines added. The PageUp/PageDown is a little funny, but the word wrap is really nice. I want to put in a Borland style Clipboard, where things stay in the Clipboard until you delete them, and you can mark text in the Clipboard for your paste operations without losing things because you knocked them off the clipboard by clipping something else. Since he already got the KISSED.BAS code from the ABC packet, I guess I'll hammer on LLED.BAS for a while and post that after I knock the bugs out of it, instead. :) I actually use KISSED.EXE for my QWK editor. I'm using it right now, in fact. There are a few things I miss, such as auto-indent, which are addressed in LLED.BAS. > ] I have a new hobby!! yawning.... :( ) --- * Origin: *YOPS ]I[* 8.4 GIG * RA/FD/FE * Milwaukee, WI (1:154/750) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F2V00008 Date: 02/25/98 From: COLIN DOMANSKY Time: 07:53am \/To: ALL (Read 3 times) Subj: Problem I have a questions brought up in my Computer Science class yesterday and I was hoping that somebody could try it out and see what you come up with Why doesn't this work for j = 1 to 3 for k = 2 to 4 step -1 print j next k next j There is no error message that comes up or nothing.. :( I want to find this out, so please help... --- ViaMAIL!/WC4 v1.30 * Origin: The Door Factory * Winnipeg, Canada (1:348/956) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F2V00009 Date: 02/25/98 From: KEN WEITZEL Time: 04:57pm \/To: COLIN DOMANSKY (Read 3 times) Subj: Problem Hi Colin... CD>I have a questions brought up in my Computer Science class yesterday and >I was hoping that somebody could try it out and see what you come up >with CD>Why doesn't this work CD>for j = 1 to 3 > for k = 2 to 4 step -1 > print j > next k >next j CD>There is no error message that comes up or nothing.. :( >I want to find this out, so please help... Hey, Colin, there's no error message because there's no error! :) It's doing *exactly* what you told it to do; which is precisely nothing except print a few blank lines... Take a good look at the line for k = 2 to 4 step -1 That says count *backwards* (step -1) from 2 to 4 :( Counting backwards from 2 to 4 is exactly nothing, try it again leaving out the step -1 part, or switch the 2 to 4 around and make it 4 to 2 :) Take care. Ken --- * QMPro 1.53 * Find out about paranoids.. just follow them around a lot * Origin: The Door Factory * Winnipeg, Canada (1:348/956) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F2V00010 Date: 02/25/98 From: COLIN DOMANSKY Time: 06:50pm \/To: KEN WEITZEL (Read 3 times) Subj: Problem -> Hey, Colin, there's no error message because there's no error! :) -> -> It's doing *exactly* what you told it to do; which is precisely -> nothing except print a few blank lines... -> -> Take a good look at the line for k = 2 to 4 step -1 -> That says count *backwards* (step -1) from 2 to 4 :( -> -> Counting backwards from 2 to 4 is exactly nothing, try it -> again leaving out the step -1 part, or switch the 2 to 4 -> around and make it 4 to 2 :) -> -> Take care. -> -> Ken Thanks Ken.. So basically, it counts it backwards? --- ViaMAIL!/WC4 v1.30 * Origin: The Door Factory * Winnipeg, Canada (1:348/956) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F2V00011 Date: 02/22/98 From: OLE HEJLSKOV Time: 07:52pm \/To: COR VAN DEN HOOVEN (Read 3 times) Subj: help! Hmmm, it it you ' Cor '? OH>> Is there a command in Qucikbasic 4.5 that gives you the current OH>> disk-space? CvdH> No, but you can use a subroutine: Oh, yes, i know, but i did'nt know how to make it.. [CUT] /\ /\ \_/_\_/ / o o \ < \_#_/ > Ole Hejlskov. \_U___/ .!. LSD will make your CGA screen display 16.2 million colors --- Terminate 4.00/Pro * Origin: The Hejlskov saga continues... (2:237/45.18) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F2V00012 Date: 02/22/98 From: OLE HEJLSKOV Time: 07:53pm \/To: MARTIJN VAN DE STREEK (Read 3 times) Subj: help! Hey! OH>> Is there a command in Qucikbasic 4.5 that gives you the current OH>> disk-space? MvdS> Why don't you try this one (from ABC): Thanks.. .oOOo. OO oOOOOo OOOO OO Ooo. OOooOO OOo. O' `OO' OOOOo OOOOo Hejlskov, Terp. .!. The only good Mac is a big Mac! --- Terminate 4.00/Pro * Origin: The Hejlskov saga continues... (2:237/45.18) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F2V00013 Date: 02/22/98 From: OLE HEJLSKOV Time: 07:54pm \/To: CHRIS GUNN (Read 3 times) Subj: Re: help! Hey Chris CG> No, but you can OPEN a BINARY file and PUT an entry at a location in the CG> file CG> for the amount of space you need to confirm is available and then KILL it CG> if CG> there are no errors. A sequence of PUT's at 1 Meg intervals will give CG> you CG> increments. Ok. CG> To get the real space you need to do SHELL "DIR > SCRAP" or use CHKDSK CG> and CG> parse what you need out of the SCRAP file. Another alternative is to CG> use the CG> appropriate Interrupt codes. OK.. >CU< \|/ ____ \|/ @~ / ,. \ ~@ /__( \__/ )__\ Ole Hejlskov. \__U_/ Terp. .!. I'm not afraid of flying, I'm afraid of crashing. --- Terminate 4.00/Pro * Origin: Terminate, take my breath away (2:237/45.18) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F2V00014 Date: 02/22/98 From: OLE HEJLSKOV Time: 07:55pm \/To: TIKA CARR (Read 3 times) Subj: BMP Hey Tika! OH>> Do you know how to play 44.100 HzM wave files, in qb? TC> Nope. Unfortunately, the only thing I saw around I think* was one for TC> 11Hz but TC> not sure what exactly. most stuff is best made at that speed anyway, for TC> compatibility. Ok.. __ (o o) --ww--(_)--ww--- Ole Hejlskov. 2:237/45.18 .!. Formatting Drive C: --- Terminate 4.00/Pro * Origin: Ole Hejlskov rulez forever! (2:237/45.18)