DADiSP Worksheet Functions > Function Categories > Annotation > FINDTEXT

 

FINDTEXT

Purpose:

Finds text handles based on property values.

Syntax:

FINDTEXT(

win1, ..., winN, "property1", value1, …, "propertyN", valueN)

winN

-

Optional. The target windows that contains the graphic objects. Defaults to the entire worksheet.

"propertyN"

-

Optional. A string, one or more property names to identify the graphics handle.

valueN

-

Optional. An integer, string, real or series value associated with the preceding property name.

Returns:

A series of text handles that match the property name/value pairs.

Example:

h = findtext(W1)

 

returns an array of handles to all text objects in W1. The array is empty if no text objects exist in the window.

Example:

h = findtext(W1, "color", lred)

h.color = yellow;

 

Returns an array of handles to all text objects in W1 with a text color of light red and sets the text color of those objects to yellow.

Example:

h = findtext(W1, W2, "color", lred, "italic", 0)

h.bg = yellow;

 

Returns an array of handles to all text objects in W1 and W2 not in italics with a text color of light red and and sets the background color of those objects to yellow.

Example:

W1: gsin(100, 1/100, 1)*5;

h1 = text(W1, 0.5, -2.0, "My Text1");h1.tag = "t1";

h2 = text(W1, 0.5,  2.0, "My Text2");h2.tag = "t2";

 

h3 = findtext(W1, "tag", "t1");

h4 = findtext(W1, "tag", "t2");

 

h3[1] == h1;

h3[1].text == "My Text1;

 

h4[1] == h2;

h4[1].text == "My Text2;

 

Returns the text handles based on the tag string property and displays the text strings. The returned handles are one element series.

Remarks:

FINDTEXT is limited to locating text objects. See FINDSHAPE to locate shape objects and FINDHANDLE to locate all graphic objects.

 

Any combination of "property name" / values can be used to locate text objects. Below is a partial list of property names:

 

Name

Type

Description

x

real

x coordinate

y

real

y coordinate

bg

integer

background color

fg

integer

text color

box

integer

draw outline around text

fill

integer

same as bg, background color

font

integer

font type identifier

lock

integer

lock interactive movement

text

string

text string

color

integer

same as fg, text color

focus

integer

target overlay focus

pitch

integer

font pitch

shape

string

readonly type of object, "text"

coords

series

text coordinates as a series

handle

integer

text handle

italic

integer

font italics

legend

integer

text is legend

tagnum

integer

same as handle, text handle

target

integer

text coordinate target, glass, paper, etc.

winnum

integer

readonly window number of text target

charset

integer

font character set

showtag

integer

show font string tag

stretch

integer

text stretch to fit flag

visible

integer

text visibility

fontname

string

font face name

fontsize

integer

font size in points

position

series

readonly bounding box coordinates of text in window coordinates

fontangle

integer

font angle (0 for horizontal)

devposition

series

readonly bounding box coordinates of text in device coordinates

 

Specific properties can be set and queried using the handle.property dot syntax.

 

See ARROWDRAW to draw an arrow line.

 

See ELLIPSEDRAW to draw an ellipse.

 

See LINEDRAW to draw one or more line segments.

 

See POLYGONDRAW to draw a closed polygon.

 

See RECTDRAW to draw a rectangle.

 

See TEXT to draw text.

See Also:

ARROWDRAW

ELLIPSEDRAW

FINDHANDLE

FINDSHAPE

ISHANDLE

LINEDRAW

POLYGONDRAW

RECTDRAW

TEXT