CLanguage.SetLanguage: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(27 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Template:APIClass|Common Class|Common}}  
{{DISPLAYTITLE:cLanguage.SetLanguage}}{{Template:API}}{{Template:APIBreadcrumb}}


=== Methods ===


*'''[[Common.SetLanguage|SetLanguage]]''' {{Template:APIComment|Sets the language for the whole library. It cannot be set separately for a different instances of classes.}}
<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==
'''.SetLanguage'''(''Language'') 
 
====Parameters====
''Language''
:Required. The display language. Can be any [[Language_Enumeration|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'''
{{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'''
{{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"}})

Latest revision as of 00:21, 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")