Skip to content

Latest commit

 

History

History
84 lines (73 loc) · 1.96 KB

File metadata and controls

84 lines (73 loc) · 1.96 KB

SetText

Description

Procedure SetText sets the content of the referenced text object. The new text is assigned the font, size and style characteristics of the first character of the old text string.

PROCEDURE SetText(
				objectHd : HANDLE;
				text     : DYNARRAY[] of CHAR);
def vs.SetText(objectHd, text):
    return None

Parameters

Name Type Description
objectHd HANDLE Handle to text object.
text DYNARRAY[] of CHAR New text string value.

Examples

VectorScript

SetText(hText,'A new text string value');

Better example:

PROCEDURE Example;
{ (c) Petri Sakkinen 1997 or thereabouts } 
VAR
theText, theRest :HANDLE;
x, y :REAL; 
textstart, moretext :STRING;
BEGIN
theText := FSActLayer;
Message('Point text blocks to be concatenated');
textstart := GetText(theText);
GetPt(x, y);
theRest := PickObject(x, y);
REPEAT
moretext := GetText(theRest);
textstart := Concat(textstart, ' ', moretext);
DelObject(theRest);
GetPt(x, y);
theRest := PickObject(x, y);
UNTIL (theRest = NIL);
SetText(theText, textstart);
ClrMessage;
END;
RUN(Example);

Python

dateflag := (flag & (GetRField(hobj,kRecName,kStatName) = kStatValYellow))|(NOT(flag) & (GetRField(hobj,kRecName,kStatName) = kStatValRed));
IF dateflag THEN BEGIN
	SetText(hobj,Date(2,0));
	IF flag THEN SetRField(hobj,kRecName,kDateName,Date(2,0)) ELSE SetRField(hobj,kRecName,kPUDateName,Date(2,0));
	END;

BEGIN
	If gDaylightSavingsOn then fDisplayStr := Concat(Num2Str(0, fHour-1), ' : ') ELSE fDisplayStr := Concat(Num2Str(0, fHour), ' : ');
	IF fMinute < 10 THEN fDisplayStr := Concat(fDisplayStr, '0');
	fDisplayStr := Concat(fDisplayStr, Num2Str(0, fMinute));
	SetText(gFrameCounterHan, fDisplayStr);
END;

BEGIN
	SetText (gIssueNoteTextH, description);
vs.SetText(objectHd, 'Example')

Version

Availability: from All Versions

Category