CLanguage.SetLanguage: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 13: Line 13:


==Example ==
==Example ==
To demonstrate the functionality, the following example deliberately returns an error message in Portuguese.
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.


   '''VB.NET'''
   '''VB.NET'''
Line 20: Line 20:
   SynthesisAPI.SetLanguage(SynthesisAPI.Language.Portuguese)
   SynthesisAPI.SetLanguage(SynthesisAPI.Language.Portuguese)
   
   
  {{APIComment|'The following code triggers the Synthesis repository to return an error message.}}
  {{APIComment|'The following code will deliberately cause the Synthesis repository to 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
   {{APIPrefix|Dim}} m {{APIPrefix|As New}} cModel

Revision as of 23:36, 11 November 2015

APIWiki.png


Member of: SynthesisAPI10


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)

Syntax

SynthesisAPI.SetLanguage(Language)

Parameters

Language

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


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.

 VB.NET

 'Set the API's language to Portuguese 
  SynthesisAPI.SetLanguage(SynthesisAPI.Language.Portuguese)

 'The following code will deliberately cause the Synthesis repository to return an error message. 
  Dim MyRepository As New Repository
  Dim m As New cModel

  MyRepository.ConnectToAccessRepository("C:\RSRepository1.rsr10")
  m = MyRepository.Model.GetModel(47)