POINT Function

 BBS: Inland Empire Archive
Date: 05-24-92 (14:14)             Number: 88
From: MATT HART                    Refer#: NONE
  To: MICHEAL KEANE                 Recvd: NO  
Subj: POINT Function                 Conf: (2) Quik_Bas
 MK> OCuld someone tell me what kindof walue POINT returns... I mean
 MK> does it return the pallete number(1-256 for VGA) or does it
 MK> return the actual color number which you get from that zany

It returns the palette number.  You can use Int 10h
Function to tell the color value in the palette.

     '$INCLUDE:'QBX.BI'       ' or QB.BI
     DIM InRegs AS RegTypeX
     DIM OutRegs AS RegTypeX

     NumPal = 256   ' 16 for SCREEN 12

     REDIM PalInfo&(0 TO NumPal-1)
     FOR i = 0 TO NumPal-1
         InRegs.ax = &H1015
         InRegs.bx = i
         CALL INTERRUPTX (&H10, InRegs, OutRegs)
         A& = (OutRegs.cx AND &HFF00) \ &HFF
         B& = (OutRegs.cx AND &HFF)
         C& = (OutRegs.dx AND &HFF00) \ &HFF
         PalInfo&(i) = 65536& * B& + 256& * A& + C&
     NEXT i

The PalInfo&() array contains the current colors for the

palette.  When the palette has changed, this can be
restored with PALETTE USING PalInfo&(0).
 * Origin: Midnight Micro!  V.32/REL  (918)451-3306 (1:170/600)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET