../pvss.htm menu.gif basics.gif

Control functions

Data types

The CONTROL programming language uses the following data types for supporting the multilingual functionality:

  • langString

  • dyn_langString

  • dyn_dyn_langString

The following operators support these data types:

 

= == != []

The index operator [ ] (starting with 1) can only be used for read-only access, so the content of a variable of type langstring cannot be changed using the operator. Using the index operator on a variable of type langstring returns a variable of the type string. Use the function setLangString() to change the contents of a variable of the type langString. When a langString variable is assigned to a string variable, then the entry in the current language from the langString is assigned to the string variable.

IconExample

Assume that three languages are supported, s[1]...s[3]. The active language has the index 1 here. The result of the first Debug instruction -- DebugN(-a,-b) in the example then reads ["German" "Hungarian" "English"] ["" "" ""].

The assignment of a value to a[1] fails, because the assignment operator only allows read operations.

 

main()
{
   langString a, b;
   dyn_string s;
   string text;
   s[1] = "German";
   s[2] = "Hungarian";
   s[3] = "English";
   a = s;
   DebugN(a, b );
   text = a[2];
   DebugN(text); // ["English"]
   a[1] = "anything"; // Error, but no message in Logviewer
   text = "Active is: " + a;
   DebugN(text); // -> ["Active is: Hungarian"]
   a = b;
   if ( a == b ) ...
  if ( a != b ) ...
}

note.gifNote

The absolute index for the languages in WinCC OA (see file search) depends on the relative index of the project languages.

Control functions

The following table lists the available functions connected with multi-language capability:

dpTranslate()

errorText()

getActiveLang()

getCatStr()

getDictionary()

getGlobalLangId()

getLangIdx()

getLocale()

getMetaLang()

getNoOfLangs()

 

langEditor()

mergeDictionary()

readDictionary()

setLangString()

switchLang()

translate()

writeDictionary()

 

Top Of Page

 

V 3.11 SP1

Copyright ETM professional control GmbH 2013 All Rights Reserved