Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What are the best I/O commands?

I/O

What are the best I/O commands?

by  qbasicking  Posted    (Edited  )
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.
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top