--------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F3300014 Date: 02/26/98 From: KURT KUZBA Time: 07:43am \/To: RICHARD MCCONNELL (Read 3 times) Subj: add textr RM> CG> X% = INSTR(Fetch$, ":") RM> CG> X$ = LEFT$(Fetch$, X% - 1) RM> CG> Param$ = LTRIM$(MID$(Fetch$, X% + 1)) RM> CG> SELECT CASE UCASE$(X$) RM> CG> CASE "DIRECTORY": Direct$ = Param$ RM> CG> CASE "PASSWORD": PassWd$ = Param$ RM> CG> END SELECT RM> This code looks good but how would the INI type file be RM> set up like this RM> INIDAT.INI RM> Directory = c:\hello RM> passwd = hiall Again. Look at what you want to do. You want to read parameter name and act on the data present with that parameter name. So just do that! Have a look at this: '_|_|_| READ_INI.BAS PUBLIC DOMAIN Kurt Kuzba 2/26/1998 '_|_|_| No warrantee or Guarantee given or implied. '_|_|_| A simple program to illustrate the use of a .INI file '_|_|_| with programs in QBasic or Quick Basic. DECLARE SUB ProgramINI (ini%) DECLARE SUB StrReverse (a$) ON ERROR GOTO OOps DIM SHARED DefaultDir$, DefaultTxtClr%, DefaultBckClr% DIM SHARED PWord$, FError$ FError$ = "ok" Infile% = FREEFILE OPEN "initest.ini" FOR INPUT AS #Infile% ProgramINI Infile% SHELL "dir " + DefaultDir$ + "*.exe" BEEP: DO: k$ = INKEY$: LOOP WHILE k$ = "" PRINT "The Password is... "; PWord$ PRINT "The Directory is... "; DefaultDir$ BEEP: DO: k$ = INKEY$: LOOP WHILE k$ = "" OOps: FError$ = STR$(ERR): RESUME NEXT SUB ProgramINI (ini%) DefaultDir$ = "C:\" DefaultTxtClr% = 15 DefaultBckClr% = 1 PWord$ = "friend" IF FError$ = "ok" THEN WHILE NOT EOF(ini%) LINE INPUT #ini%, text$ parm$ = UCASE$(RTRIM$(LEFT$(text$, INSTR(text$, " ")))) StrReverse text$ cmnd$ = RTRIM$(LEFT$(text$, INSTR(text$, " "))) StrReverse cmnd$ SELECT CASE parm$ CASE "DIRECTORY": DefaultDir$ = cmnd$ CASE "PASSWORD": PWord$ = cmnd$ CASE "TEXTCOLOR": DefaultTxtClr% = VAL(cmnd$) CASE "BACKCOLOR": DefaultBckClr% = VAL(cmnd$) END SELECT WEND CLOSE ini% ELSE PRINT "No INI file" END IF COLOR DefaultTxtClr%, DefaultBckClr% CHDIR DefaultDir$ END SUB SUB StrReverse (a$) L% = LEN(a$) + 1: Z% = (L% - 1) \ 2 FOR C% = 1 TO Z% T$ = MID$(a$, C%, 1) MID$(a$, C%, 1) = MID$(a$, L% - C%, 1) MID$(a$, L% - C%, 1) = T$ NEXT END SUB '_|_|_| end READ_INI.BAS > ] I read Doors of Perception, but I can't remember any of it.. --- * Origin: *YOPS ]I[* 8.4 GIG * RA/FD/FE * Milwaukee, WI (1:154/750) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F3300015 Date: 02/26/98 From: KURT KUZBA Time: 07:43am \/To: OLE HEJLSKOV (Read 3 times) Subj: help! OH> AK> Run checkdisk in a shell, thats the easiest way. OH> Yes, but i need it in a variabel.. Redirect the output to a file and read the file! :) SHELL "dir *.NUL > diskfree.tmp" Now just open and read "diskfree.tmp", and then KILL it. You may extract any of the data into any variable you like. > ] Edged Instruments 101 :: Innies VS. Outies.................. --- * Origin: *YOPS ]I[* 8.4 GIG * RA/FD/FE * Milwaukee, WI (1:154/750) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F3300016 Date: 02/26/98 From: KURT KUZBA Time: 07:43am \/To: OLE HEJLSKOV (Read 3 times) Subj: 800x600x256.. OH> Hello: 'All' OH> Subject: '800x600x256'. OH> Is there anyone there can help me making my program You will need to use a library, at least to call the INT 10h functions to set the VESA mode. This will require QB45. Are you using QB45 or just the QBasic that came with DOS? > ] "Does that motor sound funny to you?" : Buddy Holly....... --- * Origin: *YOPS ]I[* 8.4 GIG * RA/FD/FE * Milwaukee, WI (1:154/750) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F3300017 Date: 02/25/98 From: DAVID AUKERMAN Time: 03:32pm \/To: TIKA CARR (Read 3 times) Subj: Dave Shea TC>Well, you caught me a bit late, as I saw his post recently and we been TC>communicating in e-mail. ;) TC>Sounds like what I'll be doing (or another hiatus). I keep getting burned out TC>faster and more with all this stuff. So if you don't see me around, that's TC>why. Got too much to do, and have to cut back somewhere. Might take down the TC>web site, since I really feel no initiative to keep it up. I more or less TC>started it as an experiment to see how GeoCities works. Like Dave, I'm going TC>to give graphics a try. Just dabbling, as usual. TC>Tika Well, it never hurts to spread the word, right? :) Hmm..seems like I'm going to have to join you guys in that boat, if I haven't done so already. School and responsibilities are eating up time like crazy..it's hard for me to even check in on the echo any more (and I wasn't really in it for that long, anyway). But for the time being, I'll keep checking for the sake of the Code FAQ, until (hint, hint to whoever may be reading this) somebody else volunteers to take it from me. :) Dabbling? Not for me..lately, my programming has been very sporadic at best. --David ___ * SLMR 2.0 * I typed "FORMAT COM1" and killed a telephone operator! --- 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: F3300018 Date: 02/25/98 From: DAVID AUKERMAN Time: 03:35pm \/To: JOHN ZORTMAN (Read 3 times) Subj: Mouse in Quick Basic 4.5 JZ> Thank you very much! Yours appears at this point to be the most JZ> somewhat understandable answer yet..! I messed up (overwrote?) my JZ> QB.BI (the QB.QLB is still there at least, but the QB.BI is 0 bytes?!) JZ> and I posted here hoping to get someone to post QB.BI as a message to JZ> me. I will be checking this mouse routine out ASAP as soon as I'm JZ> able...! You're welcome! Yeah, I know what you mean. Any kind of mouse support is going to be foreign to you until you get used to it. Too bad there isn't a QB keyword like MOUSE or something that will just do it all for you. :) Hmm..losing QB.BI is a bad thing, especially if you want to use interrupts. If you have the installation disks for Quick Basic, you ought to have that file on one of those disks. Other than that, it's illegal to post it since it's copyrighted material, even though Micro$haft doesn't seem to want to sell it to anybody any more. --David ___ * SLMR 2.0 * Oxymoron: Microsoft Works. --- 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: F3300019 Date: 02/25/98 From: DAVID AUKERMAN Time: 03:41pm \/To: JOHN ZORTMAN (Read 3 times) Subj: Code FAQ 02/98 01/12 JZ> This FAQ directly answered or helped to answer several things for me. JZ> I'm wondering if there is some way I could get my hands on all of the JZ> previous FAQs which I've missed. I'm lucky enough to have a really JZ> decent sysop who could help me with getting these if I can tell him JZ> where to FREQ or however such things like this could be obtained..(?) Any and all pertinent material in any of the previous FAQs (to the best of my knowledge) is included in the Code FAQ whenever I post it. So you've got everything there is, up to this point. :) JZ> I know most programmers generally hate writing really good and JZ> complete documentation, and helping others to learn what they consider JZ> simple basics probably ranks on the list of things they'd rather not JZ> have to do right up there with that documentation stuff. Thats why I JZ> so much appreciate someone coming up with these FAQs and such like JZ> this, and want to be sure to back track and get all that I can find. You do have a point. Most programmers are too creative and think too quickly to want to slow down and explain the essentials to new programmers. I can't take the credit for the FAQ, though, since it was Dave Shea's original creation. I just took it over for him about 4 or 5 months ago. This FAQ is handy, though! JZ> Hopefully it'll keep me from repeating the same questions you guys JZ> have heard million times before... That was the general idea. :) --David ___ * SLMR 2.0 * hAS ANYONE SEEN MY CAPS LOCK KEY? --- 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: F3300020 Date: 02/25/98 From: DAVID AUKERMAN Time: 03:55pm \/To: ALL (Read 3 times) Subj: INTERRUPT help I'm looking for an easy INTERRUPT to use to check for the existance of a writeable drive (i.e. not cd-rom..yet). I've looked and looked through Ralf's INT list, but nothing seems to be popping up for me. Any help from you guys would be greatly appreciated. Thanks, --Davidf ___ * SLMR 2.0 * 8 hours of debugging and all I have is ... messy code? --- 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: F3300021 Date: 02/24/98 From: MARKUS TREINEN Time: 10:59pm \/To: OLE HEJLSKOV (Read 3 times) Subj: Re: help! ---- *Ole Hejlskov* musste am 18.02.98 zum Thema ---- *"help!"* folgendes blubbern: ;) AK>> Run checkdisk in a shell, thats the easiest way. OH> Yes, but i need it in a variabel.. No Problem :) Here it comes :) >-FREIDISK.BAS-begin---------------------------------------------------< DECLARE FUNCTION FreeDisk& (Disk%) '$INCLUDE: 'QB.BI' Laufwerk% = 0 'Choose actual Drive PRINT "Free Diskspace: " + LTRIM$(RTRIM$(STR$(FreeDisk&(Laufwerk%)))) + " Bytes" END FUNCTION FreeDisk& (Disk%) DIM REGS AS RegType REGS.AX = &H3600 'INT21h/36h = Get Disk Space REGS.DX = Disk% '0 = act.Drive, 1 = A:, 2 = B:, etc. INTERRUPT &H21, REGS, REGS 'Perform Interrupt IF REGS.AX = &HFFFF THEN 'Invalid Drive PRINT "Invalid Drive!" END END IF SecPerClus% = REGS.AX 'Sectors per Cluster FreeClusters% = REGS.BX 'Free Clusters BytesPerSec% = REGS.CX 'Bytes per Sector TotalClusters% = REGS.DX 'Total Clusters Cluster& = BytesPerSec% * SecPerClus% 'Calculate Size of Cluster FreeDisk& = Cluster& * FreeClusters% 'Calculate Total Diskspace END FUNCTION >-FREIDISK.BAS-end-----------------------------------------------------< Hope it fits your imaginations ;) Bis bald! *Hoshy Markus*. Monza-Hotlap: 1:22,175 ... *"Your Topic Is Irrelevant." - Moderator of Borg* --- KhrossPoihnt TraiPunctAihns Err * Origin: I love your blue-eyed voice... (2:2452/455.8)