Hello and welcome to a new guide on how to best use Movicon.NExT™.
In this technote we are going to show you how to concatenate text strings.
Movicon.NExT offers the user the possibility to concatenate several
String IDs by using the {StringID1}{StringID2}...{StringIDN} syntax,
where StringID1, StringID2, and StringIDN indicate the String ID inserted
in the table contained in the Texts Resource.
The objects that currently support string concatenation are:
We will now show you how to concatenate two strings in a Text object's Text property by using the following example.
In this example we will create a screen with a Text object whose
Text property will be set with the {ID1}{ID2} string.
The ID1 and ID 2 will be set with the Yes and No texts in the Text
Resource table.
When the project is run, the graphical Text object will show the concatenated
YesNo string.
First open the Movicon.NExT platform in design mode, and create, or load, a project and then create a screen in the following way:
Now that you have created the screen, change the project’s properties by inserting the screen we have just created as the project’s startup screen. To do this:
Once you have finished, click on the Save button on the toolbar to save the project.
Check that the Main screen is open, click on the Toolbox tab on
the far right next to the properties window to open the Toolbox library
offered by Movicon.NExT.
Select the Text box from the Texts folder and drag it onto the screen.
With the object selected, open its properties window and go to the
Text property and enter the {ID1}{ID2} string.
Now we shall configure the
texts table.
Select and double-click the Texts Resource on project tree to open
it.
Add two languages. for example English (United States) and Italian
in this way:
Now add the two String ID:
Repeat this procedure to insert ID2:
Open the Main screen and then open the Toolbox library again. Go
to the Buttons folder and then the Standard folder and drag and drop
a Standard Metro Style button on the screen.
With the button selected, open it properties window and enter the ENG
string in the Text property field.
Still with the ENG button selected, click on the Commands tab at the
bottom of the editor.
Open the commands panel and select to add the Languages command to
the button’s associated command list.
Configure the command in the tab’s far right by selecting the en-US
option in the Language (Culture Name) property field.
Make a duplicate of the ENG button by using the copy and paste operations
with the Ctrl+C and Ctrl+V keys. Move the new button by dragging it
to new position within the screen so that it does not overlap the
other one.
With the new button selected, open its properties window. Go to the
Text property and change the string from ENG to ITA.
With the ITA button still selected, click on the Commands tab at the
bottom of the editor.
Open the Commands panel, configure the command on the tab’s far right
by selecting the it-IT option in the Language (Culture Name) property.
Save the project by clicking on the Save All icon on the Movicon.NExT editor’s Toolbar and start runtime to try out what we have created.
With the application running, the Main screen should display the
Text object valued with the YesNo string by concatenating the two
IDs inserted in the Texts table.
When you click on the ITA button, the YesNo text will be translated
into SiNo by switching from the English (United States) to the Italian
language.
When you click on the ENG button instead, the SiNo text will be translated
into YesNo by switching from the Italian to the English (United States)
language reinvoking the concatenation while doing so.