CLanguage.SetLanguage: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
m (moved Common Class to CLanguage.SetLanguage: V10.1 update. Moved page to consolidate information and improve docs, as per SYN-I-4864.)
(V10.1 major update to documentation.)
Line 2: Line 2:




<onlyinclude>Sets the API's display language. Errors and warnings returned by the Synthesis repository to the API will be displayed in the specified language. (VB.NET only)</onlyinclude>
<onlyinclude>Sets the language of the Synthesis API library. Messages returned by the Synthesis repository to the API will be displayed in the specified language.</onlyinclude>


==Syntax==
==Syntax==
  '''SynthesisAPI.SetLanguage'''(''Language'')
  '''.SetLanguage'''(''Language'')


====Parameters====
====Parameters====
Line 13: Line 14:


==Example ==
==Example ==
This example assumes that a file called "RSRepository1.rsr10" exists in the C: drive. To demonstrate the method's functionality, the code deliberately returns an error message in Portuguese.
To demonstrate the method's functionality, the example deliberately returns an error message in Portuguese by connecting to a repository that doesn't exist.
 
  '''VBA'''
{{APIComment|'Set the API's language to Portuguese}}
  {{APIPrefix|Dim}} Lng {{APIPrefix|As New}} cLanguage
  Lng.SetLanguage (Language_Portuguese)
{{APIComment|'The following code will deliberately cause the connection to fail and return an error message.}}
  {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
  MyRepository.ConnectToAccessRepository({{APIString|"C:\RSRepositoryx122g3.rsr10"}})


   '''VB.NET'''
   '''VB.NET'''
   
   
  {{APIComment|'Set the API's language to Portuguese}}
  {{APIComment|'Set the API's language to Portuguese}}
   SynthesisAPI.SetLanguage(SynthesisAPI.Language.Portuguese)
   {{APIPrefix|Dim}} Lng {{APIPrefix|As New}} cLanguage
  Lng.SetLanguage (Language.Portuguese)
   
   
  {{APIComment|'The following code will deliberately cause the Synthesis repository to return an error message.}}
  {{APIComment|'The following code will deliberately cause the connection to fail and return an error message.}}
   {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
   {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
  {{APIPrefix|Dim}} m {{APIPrefix|As New}} cModel
   MyRepository.ConnectToAccessRepository({{APIString|"C:\RSRepositoryx122g3.rsr10"}})
   MyRepository.ConnectToAccessRepository({{APIString|"C:\RSRepository1.rsr10"}})
  m = MyRepository.Model.GetModel(47)

Revision as of 00:09, 1 March 2016

APIWiki.png


Member of: SynthesisAPI


Sets the language of the Synthesis API library. Messages returned by the Synthesis repository to the API will be displayed in the specified language.

Syntax

.SetLanguage(Language)  

Parameters

Language

Required. The display language. Can be any Language constant.


Example

To demonstrate the method's functionality, the example deliberately returns an error message in Portuguese by connecting to a repository that doesn't exist.

 VBA

 'Set the API's language to Portuguese 
  Dim Lng As New cLanguage
  Lng.SetLanguage (Language_Portuguese)

 'The following code will deliberately cause the connection to fail and return an error message. 
  Dim MyRepository As New Repository
  MyRepository.ConnectToAccessRepository("C:\RSRepositoryx122g3.rsr10")
 VB.NET

 'Set the API's language to Portuguese 
  Dim Lng As New cLanguage
  Lng.SetLanguage (Language.Portuguese)

 'The following code will deliberately cause the connection to fail and return an error message. 
  Dim MyRepository As New Repository
  MyRepository.ConnectToAccessRepository("C:\RSRepositoryx122g3.rsr10")