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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.