--------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F1E00008 Date: 01/09/98 From: ROBERT FORTUNE Time: 01:37pm \/To: ROBERT CARLSON (Read 4 times) Subj: Re: Ansi screens and code RC>I can get Ansi codes to work local just fine it when some one calls RC>in and uses the application that tey are in is were I can no seem RC>to figure out how to get them to go across the screen and not RC>scroll down until I want them to. Like make a door program playing RC>five card draw. Haveing five cards of diffeert nomination and RC>color placed across the screen in a roll and being able to RC>change what card you want and hold the others and when you do this RC>the screen clears, but the cards come back in the same position RC>and not scroll down the screen. Every thing is fine working RC>locally, but not over a modem, it just scroll down the screen on the RC>left hand side. For every LOCAL screen positioning and screen output statement, you need to do the exact same screen positioning for the remote screen. The exact statement you use to send the screen positioning and screen displaying to the remote screen depends on whether you are using a pre-written BBS door or communications library or if you are using your own QB communications code. Every BBS door or communications library for use with QB has its own command for sending output to the remote computer via the modem. As an example, if you were using the PDQComm communications library it has a ComPrint(Text$) command that allows you to send screen output to the remote caller's screen. For every PRINT #n, SomeANSI$ statement in your program, you would need to have a ComPrint(SomeANSI$); statement to send the exact same ANSI to the remote user's screen that you are displaying on the local screen. As in: PRINT #1, SomeANSI$; ' this covers the local screen only ComPrint(SomeANSI$); ' this would do the remote screen (if using PDQComm) It would be best if you use a single SUB called say Display(Text$) and in that SUB you send screen output to both the local and remote screens. SUB Display(Text$) PRINT #1, SomeANSI$; REM IF Carrier% THEN ComPrint(SomeANSI$); ' if u were using PDQComm END SUB Then you could use the Display SUB each time you need to send output to both the local and remote screens as in: SomeANSI$ = CHR$(27) + [2J" ' ANSI clear screen code Display SomeANSI$ ' Display SUB handles local and remote screens RC>If any one has a soruce code in Quickbasic that show how to RC>do this and be able to send over a modem. RC>I would highly apprecicate it. ' ------------------ CUT HERE ------------------- CUT HERE --------------- REM SOMEANSI.BAS REM 1/9/1998 REM This code requires that you have the ANSI.SYS console device driver REM loaded at bootup time via your CONFIG.SYS file. DEFINT A-Z ' all untyped variables will now default to type integer DECLARE SUB MoveCursor (X%, Y%) DECLARE SUB SetColors (FG%, BG%, Attr%) OPEN "CONS:" FOR OUTPUT AS #1 ' Open the CONSole device driver ESC$ = CHR$(27) ' ESC code Cleer$ = ESC$ + "[2J" ' ANSI clear screen CRLF$ = CHR$(13) + CHR$(10) ' Carriage return-line feed pair Blink$ = ESC$ + "[5;1m" ' Blinking ANSI color(s) Reset$ = ESC$ + "[0m" ' Reset ANSI color to white on black PRINT #1, Cleer$; ' Clear the screen REM ComPrint(Cleer$); ' Here you would clear the remote screen FG% = 33 ' Set ANSI ForeGround color to yellow BG% = 40 ' Use black ANSI BackGround color Attr% = 1 ' Use ANSI bright\bold colors SetColors FG%, BG%, Attr% Text$ = "Cry havoc and let loose the dogs of war!" X% = 15 Y% = 39 - LEN(Text$) \ 2 + 1 MoveCursor X%, Y% PRINT #1, Text$; ' Do the local screen REM CALL ComPrint(Text$); ' Here you would send this to the remote screen PRINT #1, Reset$ ' Reset screen colors to drab white on black. REM CALL ComPrint(Reset$); ' Again you send the same to remote screen. CLOSE #1 ' All done. Close CONSole device. END ' The End. DEFSNG A-Z REM Position cursor on local and remote screens (if using PDQComm) SUB MoveCursor (X%, Y%) Move$ = CHR$(27) + "[" + LTRIM$(STR$(X%)) + ";" + LTRIM$(STR$(Y%)) + "H" REM IF Carrier% THEN CALL ComPrint(Move$) ' for remote screen PRINT #1, Move$; ' for local screen END SUB DEFINT A-Z REM Set ANSI screen colors (local and remote) REM FG% = foreground color, BG% = background color, Attr% = attribute REM ' Possible values for attribute (Attr%): ' ' 0 All attributes off (resets everything) ' 1 High intensity (bright\bold) on ' 4 Underline on (mono screens only; blue otherwise) ' 5 Blink on ' 7 Reverse video on (black on white) ' 8 "Cancelled" (invisible) ' ' Possible ANSI color values: ' ' Color Background (BG%) Foreground (FG%) ' Black 40 30 ' Red 41 31 ' Green 42 32 ' Yellow 43 33 ' Blue 44 34 ' Magenta 45 35 ' Cyan 46 36 ' White 47 37 ' SUB SetColors (FG%, BG%, Attr%) Text$ = CHR$(27) + "[" + LTRIM$(STR$(Attr%)) + ";" + LTRIM$(STR$(BG%)) Text$ = Text$ + ";" + LTRIM$(STR$(FG%)) + "m" PRINT #1, Text$; ' display ANSI on the local screen REM IF Carrier% THEN CALL ComPRINT (Text$); ' Send output to comport END SUB ' ------------------ CUT HERE ------------------- CUT HERE --------------- Hope that helps. Good luck! - Robert * OLX 2.1 TD * Welcome my son. Welcome to The Machine. --- PCBoard (R) v15.3/M 10 * Origin: MoonDog BBS RIME NetHub Brooklyn,NY (1:278/15) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F1E00009 Date: 01/09/98 From: BILL WHITE Time: 12:00am \/To: ALL (Read 4 times) Subj: COM Ports I've seen the answer to this pass thru dozens (hundreds?) of times, but I never wanted it and didn't save it. Now I want it and don't have it. I'd think this would be in the CODE.FAQ, but it isn't. How do you open Com Port #3? FIDO: Bill White @ 1:135/110 (Miami) InterNet: bill.white@110.sunshine.com * SLMR 2.1a * Better to have loved and lost than be stuck with a jerk! --- Maximus 2.01wb * Origin: Miami Amateur Computer Club BBS/USR Courier V.E (1:135/110) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F1E00010 Date: 01/09/98 From: DAVID AUKERMAN Time: 04:57pm \/To: JEFF ROOT (Read 4 times) Subj: Default Directory JR>I may have known how to do this once. If so, I've forgotten. JR>What is a good way to preserve the current default directory JR>so that it can be restored on exit -- in QBASIC? Use of the JR>SHELL command is perfectly ok. Good, because if you don't want to use SHELL, you're going to have to get into INTERRUPTs..a little bit harder to grasp. :) If you need the current directory preserved, you'll probably need the current drive stored, too, so you can get on the right drive before trying to get to the right directory. You can just do a CHDIR to a certain directory, but if it's on a drive other than the current drive, it doesn't automatically get changed to that drive. To make a long story short..put this at the beginning of the program: SHELL "cd > savedir.jjj" 'some obscure filename will do the trick OPEN "savedir.jjj" FOR INPUT AS #1 LINE INPUT #1, CurrentDirectory$ CurrentDrive$ = LEFT$(CurrentDirectory$, 1) Then, when you're done with the program: SHELL CurrentDrive$ + ":" CHDIR CurrentDirectory$ And that should do it. Hope this helps! --David ___ * SLMR 2.0 * Keyboard not attached. Press F1 to continue. --- Maximus/2 3.01 * Origin: The I.O. Board - 4GB -X< Anderson, IN >X- V34+ (1:2255/10) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F1E00011 Date: 01/09/98 From: DAVID AUKERMAN Time: 05:24pm \/To: RONALD SCHLEGEL (Read 4 times) Subj: Sorting RS> Does anyone know any good sorting routines? I am trying to take RS>the contents of 1 file, sort it, and write the sorted results to RS>a 2nd file. I'm looking for both a numeric & alphabetic routines: There are a whole lot of sorting routines. Some are quicker than others to code, but others run much more quickly than those. For simplicity(that of my sorting capabilities)' sake, I'll do one of the easiest for you, the bubble sort. At least, I think that's what it's called.. The same process works for both of your examples. It's just a matter of putting in the right variables in the right places. You said you need to know the number of records, but that can change with every run of the program. Not a problem. TYPE BillCustomer NAME AS STRING * 40 OWES AS INTEGER END TYPE TYPE WorkForCustmer NAME AS STRING * 40 ORDERED AS INTEGER ONHAND AS INTEGER END TYPE '**the following code will count the records '(You may need to put in an INPUT routine to choose 'which kind of data you're reading. I'll assume that 'to be stored in FileType%.) File$ = "datafile.dat" 'insert correct name here Records% = 0 'init the counter CLOSE SELECT CASE FileType% CASE 1: REDIM Count AS BillCustomer CASE 2: REDIM Count AS WorkForCustomer CASE ELSE: STOP 'FileType% must = either 1 or 2 END SELECT CLOSE: OPEN File$ FOR RANDOM AS #1 LEN = LEN(Count) DO UNTIL EOF(1) Records% = Records% + 1 GET #1, Records%, Count LOOP Records% = Records% - 1 'to remove the final blank loop '**the following code will read in the records SELECT CASE FileType CASE 1: REDIM Array(1 TO Records%) AS BillCustomer CASE 2: REDIM Array(1 TO Records%) AS WorkForCustomer END SELECT FOR i% = 1 TO Records% GET #1, i%, Array(i%) NEXT i% '**the following code will sort the records FOR i% = 1 TO Records% FOR j% = i% + 1 TO Records% SELECT CASE FileType CASE 1 IF Array(j%).OWES < Array(i%).OWES THEN SWAP Array(j%), Array(i%) 'I believe this will 'swap both elements END IF CASE 2 IF Array(j%).NAME < Array(i%).NAME THEN SWAP Array(j%), Array(i%) 'same here END IF END SELECT NEXT j% PUT #1, i%, Array(i%) 'It should work..outputting each result immediately 'after each record is sorted out NEXT i% CLOSE RS>The main thing is that I need to be able to write the sorted RS>results to a new file...SORTDEMO.BAS has me totally lost. Well, I hope this helps. :) --David ___ * SLMR 2.0 * Veni Vedi Velcro: I came, I saw, I stuck around. --- Maximus/2 3.01 * Origin: The I.O. Board - 4GB -X< Anderson, IN >X- V34+ (1:2255/10) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F1E00012 Date: 01/09/98 From: CHRIS GUNN Time: 02:57pm \/To: ROBERT CARLSON (Read 4 times) Subj: Re: Ansi screens and codes RC> do this and be able to send over a modem. RC> I would highly apprecicate it. Howdy Bob, Are you sure the other end has ANSI.SYS installed? Their terminal program also has to be ANSI compatible. If they've got a filter active, they may be changing the Escape CHR$(27) character to something else. Chris --- FMail 0.96 * Origin: BIZynet - Worldwide Business via the E-Ways (1:15/55.1) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F1E00013 Date: 01/09/98 From: CHRIS GUNN Time: 03:08pm \/To: MATT DE GABRIELLE (Read 4 times) Subj: Re: Help MG> Hiya... I was wondering if someone in this echo could help me... MG> 104 Relay A1,A2 Down MG> 105 Relay D3,D4 Up MG> -+--+--+--+--+--+--+--+--+--+--+--+--+- Howdy Matt, What you have in mind is not simple even if all of your components will be in series with no parallel paths. First off you need a complete wire list which identifies where each component is located as well as where the wires run. Are you familiar with what a wirewrap circuit board looks like? Chris --- FMail 0.96 * Origin: BIZynet - Worldwide Business via the E-Ways (1:15/55.1) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F1F00000 Date: 01/08/98 From: SHANE DAY Time: 01:22am \/To: ALL (Read 4 times) Subj: Fading Could someone Suggest How to do a Fade in Quick basic with an ANSi file the routine I made is to long and I can't figure a better way to optimize it. - Shane Day --- Renegade v5-11 Exp * Origin: Cranial Disturbance (613)723-9841 (1:163/572) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F1F00001 Date: 01/08/98 From: RABIN VONGPAISAL Time: 11:21pm \/To: CHRIS GUNN (Read 4 times) Subj: Re: self executing While Chris Gunn was blabbing away about Re: self executing, Rabin Vongpaisal decided to bud in. CG> RV> Does anybody know a command for quick basic to make it self executed CG> RV> on a certaine time and certain day? CG> CG> Howdy Rabin, CG> CG> You have to use an event schedule program or build your own. All of the Fi CG> Mailer programs have one built into them. CG> CG> Chris CG> CG> --- FMail 0.96 CG> * Origin: BIZynet - Worldwide Business via the E-Ways (1:15/55.1) Were could i get a program to do that? --- Renegade v5-11 Exp * Origin: Cranial Disturbance (613)723-9841 (1:163/572)