
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper 5.2 . Technical Reference - <b>_gtpostext()</b>
[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
_gtPostExt()
Return control to the General Terminal system
------------------------------------------------------------------------------
C Prototype
#include "gt.api"
ERRCODE _gtPostExt(void)
Returns
_gtPostExt() returns zero if successful. Any other value indicates an
error.
Description
_gtPostExt() returns control to the General Terminal system after direct
video access.
Warning! Always call _gtPostExt() after direct video access.
Examples
. This example uses _gtPostExt() to reengage the General
Terminal system after attempting to reverse the screen attribute of a
passed coordinate using direct video access:
/***
*
* Reverse text Attribute for passed coordinates
*
*/
#include "extend.api"
#include "gt.api"
#define VIDSEG (_gtIsColor() ? 0xB800 : 0xB000 )
#define MK_FP( seg, off ) \
((FARP) ( ((ULONG)(seg)<<16) | (USHORT)(off) ));
CLIPPER ReverseAttribute()
{
USHORT uiRow = _parni(1);
USHORT uiCol = _parni(2)
USHORT uiNumCols = _gtMaxCol() + 1;
BYTEP *scrPtr;
_gtPreExt(); // Release display context!
// Make a far pointer to row/col in video memory
scrPtr = MK_FP( VIDSEG, ( ( uiRow * uiNumCols ) +
uiCol ) * 2 );
// Skip one to the attribute
scrPtr++;
// Reverse the attribute
*scrPtr = (*scrPtr >> 4) | ((*scrPtr & 0x07) << 4) |
(*scrPtr & 0x08) | (*scrPtr & 128);
_gtPostExt(); // Signal end of external code.
_ret(); // Post a NIL return value
}
Files: Library is CLIPPER.LIB, header file is Gt.api.
See Also: _gtPreExt()
Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson