Skip to main content

Object names

Every object on a page has a name. Scripts find objects by their name, and the names of an object's event handlers are made from it. If two objects had the same name, a script could change the wrong one. YTCC therefore does not let two objects share a name.

Where a name must be unique​

A name must be unique within the page, symbol, popup or layout that you are editing, whatever the type of the objects. A rectangle and a button on the same page cannot both be called Pump. Two different pages can each have an object called Pump.

How names are compared​

YTCC ignores the difference between capital and small letters and the spaces at the start and the end. Feed Pump, FEED PUMP and feed pump count as the same name. Spaces inside the name are kept. Spaces at the start and the end are removed when you save the name.

A script, however, uses the name exactly as it is written, so write it in the script the same way as on the page.

Naming and renaming​

A new object gets the name of its type and the next free number, for example rectangle_1, rectangle_2. A copy that you paste or duplicate gets a free name of its own: Feed Pump becomes Feed Pump 2, and rectangle_1 becomes the next free rectangle_ number. YTCC does not ask about these names.

To rename an object, select it and type the new name in Name in the PROPERTIES panel. F2 takes you to the field. Press Enter to save the name or Esc to leave it as it was.

When a name cannot be used​

While you type, the field turns red and a message appears under it:

MessageCause
"<name>" already exists. Please choose a different name.Another object in the same page, symbol, popup or layout has this name.
A name must be provided.The field is empty.

If you press Enter or leave the field with a name that cannot be used, YTCC shows the message once more and the field returns to the old name.

Page, symbol and popup names​

Pages, symbols and popups are saved as files, so their names are compared by the file name made from them, not by the text you see. Letters other than A–Z, digits, - and _ become _ in the file name, and Turkish letters become their plain forms (ş becomes s). Capital and small letters are not told apart here either. Page 1 and page_1, or Şalter and Salter, therefore count as the same name.

MessageCause
"<name>" already exists. Please choose a different name.Another item of the same kind has a name with the same file name.
"<name>" is not valid as a file name. Please choose a different name.No usable file name is left, for example for ***.
A name must be provided.The name is empty.