BBS: Inland Empire Archive Date: 05-11-92 (21:18) Number: 182 From: SCOTT DRYSDALE Refer#: NONE To: RICHARD MCCARRON Recvd: NO Subj: DISK SPACE AVAILABLE -QB Conf: (2) Quik_Bas
Hi, your question: RM> IS IT POSSIBLE TO WRITE A SUB ROUTINE IN QUICK BASIC TO RM> CHECK HOW MUCH SPACE IS AVAILABLE ON HARD OR FLOPPY DISK RM> WITH THE VALUE IN A VARIABLE . Yes, and the solution is EASY! Heres how it works, you ever heard of how to use SCREEN(x,y) to see what's on a screen. It's like this A$ = chr$(SCREEN(1,1)). Then if you're working in screen 0,0,0,0 (won't work in screen 13), try: screen 0,0,1,0 locate 24,1 ' so it scrolls so that the very last line files ' is bytes available (but all invisably!) for i = 1 to 13 ' reads bytes a$ = chr$(SCREEN(23, i)) ' I beleive 23 is the right row a$ = a$ + a$ ' adds to string next i bytesleft = VAL(a$) ' leaves you with just number of bytes screen 0,0,0,0 ' swiches you back MAN, that's good!! And I just did that off the top of my head, I should write a book "What they forgot in QB45". --- Maximus 2.01wb * Origin: The BULLpen BBS * Intel 14.4EX (613)549-5168 (1:249/140)
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