TextXor Command

Purpose

Output of an expression as graphic text with a bitwise exclusive OR of the destination and source.

Syntax

TextXor x!,y!, exp

x!,y!:Single
exp:svar or sexp

Description

TextXor x, y, exp prints expression exp as graphic text at coordinates x, y. The ScaleMode property determines the unit of measure used. The foreground color of the text is set using RGBColor, Color, or QBColor.

TextXor allows to place text on the background without disturbing the background. Under Windows 3.1 often used construction GraphMode R2_XORPEN : Text x, y, exp is ignored under Windows 95. This makes it impossible to restore the background when the text is displayed twice in the R2_XORPEN grahpmode.

Example

OpenW 1

Dim x As Int, y As Int, k As Int

Dim xo As Int, yo As Int

For x = 0 To _X Step 40

Line x, 0, x, _Y

Next x

For y = 0 To _Y Step 40

Line 0, y, _X, y

Next y

y = -80, yo = y

Global doexit As Boolean = False

Do

Sleep

If !doexit

Mouse x, y, k

If x != xo || y != yo || k = 1

TextXor xo, yo, xo & yo

If k = 1 Then QBColor Rand(16) : _

Circle x, y, 24

xo = x : yo = y

TextXor x, y, x & y

EndIf

EndIf

Until Me Is Nothing

 

Sub Win_1_Close(Cancel?)

doexit = True

EndSub

Writes "Test Test Test" in different ways to the screen.

Remarks

GrayText is another variant on Text.

See Also

Print, Print At, Text, GrayText, ScaleMode, Color, RGBColor, QBColor

{Created by Sjouke Hamstra; Last updated: 25/10/2014 by James Gaite}