• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Lesson 26. Using a List Database > Concatenating Two Expressions

Concatenating Two Expressions

Now that you have a way to find what direction is displayed on the stage, you will add the direction to the location choice selected by the user to create a cast member name. Adding two expressions together is called concatenation, and in Lingo you perform concatenation using the & symbol. You can concatenate strings to create a new string. For example, the statement put "abra"& "cadabra" concatenates the strings "abra" and "cadabra", resulting in the string "abracadabra". When using a string, you surround it with quotation marks to indicate that Director should read the text as a string and not as a variable, numerical value, or Lingo element.

You can also concatenate variables. Suppose you have two variables, myName and myInitials, that are set to "Tristen" and "TT", respectively. To concatenate these variables, you would type put myName&myInitials in the Message window. The result would be "TristenTT". To separate the name and initials, you could use a period between the two variables. To do this, you must use quotation marks around the period to indicate that it is a literal value (that is, that it's a string and not a variable, numerical value, or Lingo element). For example, this statement concatenates myName and myInitials and places a period between the two variables: put myName&"."&myInitials. The result would be "Tristen.TT".


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint