Subj : Re: DOS question To : borland.public.cpp.borlandcpp From : waking@idirect.com (Wayne A. King) Date : Sat Jul 12 2003 10:40 am On 11 Jul 2003 12:49:29 -0700, "Rob C" wrote: >There is a function in >powerC called ‘readch();’ that reads the characters and >attributes currently on the screen, *Does* it read the attributes? I thought it only reads the *character* at the current cursor position? PowerC has readattr() to get the attributes of the character at the current cursor position. >I’m now using the DOS (standard) platform of Borland >C++ 5.02 and am asking what function I would use to perform that >same operation. BC++/TC++ for DOS have more functions in conio.h than PowerC. Some of these are for screen manipulation. See for example the gettextinfo() function in the help. Note that you can easily create your own version of readch() using one of the DOS interrupt functions in BC++, such as intr(), int86(), etc. and the video interrupt 0x10, func 0x08. e.g. - #include int readch(void) { struct REGPACK rp = {0}; rp.r_ax = 0x0800; intr(0x10, &rp); return rp.r_ax & 0x00ff; } or int readch(void) { union REGS regs; regs.h.ah = 0x08; regs.h.bh = 0; int86(0x10, ®s, ®s); return regs.h.al; } -- Wayne A. King (ba994@torfree.net, wayne.king@ablelink.org, waking@idirect.com, Wayne_A_King@compuserve.com) .