INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS
Come Join Us!
Are you a
Computer / IT professional?
Join Tek-Tips now!
- Talk With Other Members
- Be Notified Of Responses
To Your Posts
- Keyword Search
- One-Click Access To Your
- Automated Signatures
On Your Posts
- Best Of All, It's Free!
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.
Partner With Us!
"Best Of Breed" Forums Add Stickiness To Your Site
(Download This Button Today!)
"...I think the forum is a great idea, especially for those of us in consulting engineering. Keep up the good work!..."
Where in the world do Tek-Tips members come from?
What are the best I/O commands?
Posted: 21 Mar 02 (Edited 10 Oct 03)
I have seen some questions about I/O on this forum, but they were scattered about, here is a quick refernce of the I/O commands, and what they are good for.
INPUT #/PRINT #: These are very good for access of things that you would put into an array, mainly because they are very quick. They are also usefull for loading bitmaps and text files, but not prefered here, since jumping around the program using SEEK tends to be a bit slow. They also open up the COM ports and allow you to swap information with other computers.
OUT/IPN: These are best for sending information to RAM or to a port other than COM. Meaning, it would be pretty good for USB or LPT1. I use them mostly for sending controls to the monitor.
PEEK/POKE: This is best for reading BIOS or reading/writing to specific RAM positions, but it can access almost anywhere in the computers working, again I use them mostly for monitor control. Be careful with POKE, if you put something in the wrong place it may permanately damage your computer.
GET/PUT: This is what you want to use if you need to work with files, such as a word processor, or a GUI. This is what most programmers use for files that are stored on a disk, since the programmer has complete control over where in the file everything is stored. They don't work well at all for much else, and they are fairly slow.
WRITE: This command works very much like the PRINT statement, I never use it.
BLOAD/BSAVE: By far the fastest way to load or save huge chunks of data, on my 386 computer it can save a 32KB file almost instantly. This is the best for huge arrays, that loading by looping would be too slow. I have used these time and time again for images that I have use GET to store a screen image.
Back to QBasic FAQ Index
Back to QBasic Forum
Join Tek-Tips® Today!
Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.
Here's Why Members Love Tek-Tips Forums:
- Talk To Other Members
- Notification Of Responses To Questions
- Favorite Forums One Click Access
- Keyword Search Of All Posts, And More...
Register now while it's still free!
Already a member? Close this window and log in.
Join Us Close