CreateText

Family: Text · 2 forms

What it does

CreateText brings a Text object into being: it is how the rest of the program comes to have one. It takes textID (an integer) and string (a string), and returns nothing. That is the first of 2 forms. textID is the id you are giving a Text object: every later call names it by that number.

Syntax

1
CreateText(textID integer, string string)
2
CreateText(string string) → integer

Parameters

NameTypeIn forms
textIDinteger1
stringstringall

What each form returns

1CreateText(1, "hello")nothing
2text = CreateText("hello")integer

Example · generated

Form 1, you choose the id yourself

CreateText(1, "hello")DO  Sync()LOOP

Form 2, the command hands back the id

text = CreateText("hello")DO  Sync()LOOP

CreateText is called with values of the types its signature asks for. The DO … LOOP is not decoration: a classic BASIC program ends the moment it runs out of lines, and Sync() is what draws the frame.

68 commands in Text