Go to: Synopsis. Return value. Keywords. Flags. MEL examples.
displayString [-delete] [-exists] [-keys] [-replace] [-value string] [string][string][string][string]
displayString is NOT undoable, queryable, and NOT editable.
Assign a string value to a string identifier. Allows you define a string in
one location and then refer to it by its identifier in many other locations.
Formatted strings are also supported (NOTE however, this functionality is now
provided in a more general fashion by the format command, use of format
is recommended). You may embed up to 3 special character sequences
^1s, ^2s, and ^3s to perform automatic string replacement. The
embedded characters will be replaced with the extra command arguments. See
example section for more detail. Note the extra command arguments do not need
to be display string identifiers.
None
In query mode, return type is based on queried flag.
display, string
delete, exists, keys, replace, value
Long name (short name) |
Argument types |
Properties |
-delete(-d)
|
|
|
|
This flag is used to remove an identifer string.
The command will fail if the identifier does not exist.
|
|
-exists(-ex)
|
|
|
|
Returns true or false depending upon whether the specified identifier exists.
|
|
-keys(-k)
|
|
|
|
List all displayString keys that match the identifier string.
The identifier string may be a whole or partial key string.
The command will return a list of all identifier keys that contain this
identifier string as a substring.
|
|
-replace(-r)
|
|
|
|
Since a displayString command will fail if it tries to assign a new value
to an existing identifer, this flag is required to allow updates
to the value of an already-existing identifier. If the identifier does
not already exist, a new identifier is added as if the -replace flag were
not present.
|
|
-value(-v)
|
string
|
|
|
The display string\'s value. If you do not specify this flag when
creating a display string then the value will be the same as the
identifier.
|
|
Flag can appear in Create mode of command
|
Flag can appear in Edit mode of command
|
Flag can appear in Query mode of command
|
Flag can be used more than once in a command.
|
// Associate a string with an identifier.
//
displayString -value "Hello world" kExampleHelloWorld;
// Query string associated with an identifer.
//
displayString -query -value kExampleHelloWorld;
// Define a simple formatted string to append ellipses.
//
displayString -value "^1s..." kExampleEllipsesFormat;
displayString -query -value kExampleEllipsesFormat kExampleHelloWorld;
// Define a formatted string using all the available
// embedded characters.
//
displayString -value "These ^1s are ^2s me ^3s" kExampleAnotherFormat;
displayString -value "pretzels" kExamplePretzels;
displayString -query -value kExampleAnotherFormat kExamplePretzels "making" "thirsty";
// Obtain a list of matching displayString keys.
// In the first example a list of all keys containing the substring
// "niceName".
// In the second example a list of all keys in the string set
// m_testStrings
displayString -query -keys "niceName";
displayString -query -keys "m_testStrings.";
// If you don't specify the -v/value flag on creating then
// the value will be the same as the identifier.
//
displayString kExampleMissingValue;
displayString -query -value kExampleMissingValue;
// Delete a string identifer.
//
displayString -delete kExampleHelloWorld;