Another approach..

 BBS: The MOONFLOWER
Date: 05-20-33 (  :  )             Number: 21
From: JACK HUDGIONS #60 @9443*2    Refer#: NONE
  To: ALL                           Recvd: YES 
Subj: Another approach..             Conf: (218) QuickBASIC

Reply To: Lightnin #42 @5912 L| Let's say for instance, I just want to see free space on a drive.., | does anyone have a handy and easy (most importantly) way to program | this call in from line numbered basic? Then maybe a shortie example | on how to do this in non-line num format? Here's a quick example. Sorry, no line numbers! <grin> Before you try this, make sure you run QB with the /L switch, which tells it to load the QB.QLB quick library. This is needed to make CALL INTERRUPT work. ' $INCLUDE: 'QB.BI' Note: Change QB.BI to QBX.BI for PDS. DIM InReg AS RegType, OutReg AS RegType DriveLetter$ = "C" InReg.AX = &H3600 InReg.DX = ASC(DriveLetter$) - 64 CALL Interrupt(&H21, InReg, OutReg) FreeClusters& = OutReg.BX - 65536 * (OutReg.BX < 0) PRINT "Space free on drive ";DriveLetter$;": "; PRINT USING "#########"; FreeClusters& * OutReg.AX * OutReg.CX END Note that in this example, the drive letter is hard-coded to C. In an actual program, you wouldn't do this! <grin> --- OLX 3.01 30-4008 Please do not read this tagline. $$ $$ Re: Got a Quick question... [0m [32m> [0m Previously, David Smith #1 @1205607*1 wrote to All [0m [32m> [0m Re: Got a Quick question... At: 04-30-93 10:49 [0m [32m> [0m DS> FOR x = 1 TO 50000: NEXT x <--Thought this would be best to [0m [32m> [0m DS> I can definately tell this routine makes the BBS run a littl e slower. [0m [32m> [0m DS> Would there be a better approach to this routine? [0m [32m> [0m I wouldn't use this loop here, as it is wasting CPU time. Use th e [0m [32m> [0m SLEEP s& command instead to sleep s& seconds. [0m [32m> [0m [0m [32m> [0m ... Origin: HOG-2 * LA County * VBBS 6.0 @8180 * End of message [0m [32m> [0m ___ Blue Wave/QWK v2.12 Try this: SUB Pause (Seconds AS INTEGER) FOR h = 1 TO Seconds t$ = TIME$ DO LOOP UNTIL t$ <> TIME$ NEXT h END SUB $$ Origin: HOG-2 VirtualNET/HOGnet @8180 DM @818-369-1223 Los Angeles County [0m
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET