Programs - CrtMem


Aim

The reason for writing this unit was so that I could do some advanced screen usage in my dos version of LanChat. It was necessary to do this because three different sections of the screen had data simultaneously and each section needed to be managed separately. The other trick was that only one section needed to have the focus, i.e. needed a cursor. The other two were non-input sections

Method

Basically I just duplicated the output routines that could be found in the CRT unit, all the non-output, i.e. input and sound didn’t have to be duplicated because they could be accessed from the old unit and would work the same.

What’s different

All the procedure and function name start with ‘m’, this is to avoid confusion with the CRT unit when both are used at once. A few new procedures and functions have been added:

  • mhidecursor - this moves the cursor off screen so that it can’t be seen, useful if the CRT unit is not being used or a dialog box is active,
  • msavepos and mrestpos - the two procedures do exactly what they are called, they save and restore the position of the imaginary ‘cursor’. This is used for quickly going somewhere else to write something on the screen and then wanting to go back to where you were and not wanting the bother of having to manage the variables yourself,
  • mgetchar - this function returns what character is at a certain position on the screen, was used to get the login name of the current user off the screen,
  • mscroll - interface for the bios routine, scrolls text in a box on the screen, either up or down. Used in Chat to scroll the name list, saves having to redraw the whole list.