VS:SetText

From Vectorworks Developer
Revision as of 14:38, 12 August 2013 by Root (talk | contribs) (1 revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

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

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

Example

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


Version

Availability: from All Versions