Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uupsi!sunic!dkuug!imada!micro From: micro@imada.ou.dk (Klaus Pedersen) Newsgroups: comp.sys.atari.st.tech Subject: Re: How to intercept TOS vectores Keywords: XBRA Message-ID: <1991May23.170948.12410@imada.ou.dk> Date: 23 May 91 17:09:48 GMT References: <1991May19.185424.18475@imada.ou.dk> <3394@quepasa.cs.tu-berlin.de> <1991May21.185858.2974@imada.ou.dk> Sender: news@imada.ou.dk (USENET News System) Organization: Dept. of Math. & Computer Science, Odense University, Denmark Lines: 32 I just want to continue my list of bad programming pratice, but without examples. - Don't use ScanCodes to check for any key on the main keyboard, use them only to check for HELP, UNDO, Fx, ESC ... Don't use it for 'Z', 'Y', '[', or any other. If you use ALT+key, then use the KeyBoardTable to convert the scancode to ASCII, then check that. Don't replace the buildin Keyboardtable ('cept if that is what your program is supposed to do). - Remember to use wind_update(BEG_UPDATE)/wind_update(END_UNDATE), when you are drawing on the screen. To avoid an other process smears the screen (eg ScreenMgr) - Don't assume that because you only have one window, that you then don't have to process WM_REDRAW or VM_TOP/WM_NEWTOP messages. - When you Allocate memory, then remember to leave some (8Kb+) for AES, VDI, GEMDOS, and accessorys. On a related subject, don't : p = Malloc( (long) int_var); This will work if int_var is less than 32Kb, else it will fail big! The strange thing is that if replace it with a 'malloc-stdio' then it will probaly work, because it often is suppost to take int vars. - Don't mix BIOS/GEMDOS screen output (input?) with a Gem program. There might come graphics cards that jump into textmode when it is told to output text like (PC's). - Stop using the LineA routines. (I need help on this - also Init?). -Klaus, micro@imada.ou.dk