Entry points > Module Supervisor > Standard script SERVSYS 

LANRUN: Modify the launching language of a batch request

This entry point is used to modify the language at each launch requests by the batch server.

For now, the batch task is launch with the language code of the batch server. For a multi-language solution (mono or multi-folder), this can be a problem when dealing with import error messages (because the messages generated by the mess() functiondepend on the language code of the adonix that has been launched.

Indeed, the SERVSYS process looks for the language used by the batch server that is stocked in GLANGUE among the list of languages defined for the folder. 

For instance: for a solution with N folders for which a local language and an admin language have been defined (i.e.: ESP-FRA, ENG-FRA). If the batch server is launched with the FRA language, all messages in all files will be in French.
The request is the following:
messages in English for a folder in ENG, messages in Spanish for a folder in Spanish. The admin messages will remain in French in the English folder and the Spanish folder.

Warning:

The batch server executed on the SERVX3 folder uses the SERVSYS process that can be found in the TRT directory of the X3 standard reference folder.

The entry point declaration and the the specific process associated with it must be located in the X3 reference folder so that this entry point might be taken into account.
Moreover, as all global variable are not declared, it is advised to test their presence before using them. For instance, the GLON* global variable are not declared.

Context and operating method

Entry point LANRUN is called each time a request is launched. It is located in the REQUETE subprogram of the SERVSYS process:

REQUETE(PID) subprog
Variable Char PID
Local Char LANGUE(5)
If clalev([F:ADS])=0: Local File ADOSSIER [ADS]: Endif
Read [ADS]DOSSIER = [F:ABR]DOSSIER
GPE = 0
GPOINT = "LANRUN": Gosub ENTREE From EXEFNC
If !GPE
 If find(GLANGUE,[F:ADS]LAN(0..[F:ADS]NBRLAN-1))
   LANGUE = GLANGUE
  Else
    LANGUE = [F:ADS]LAN(0)
  Endif
Endif

For info, under Unix, the batch task will be launched when the following system command is launched (depending on the options):

EXEC_ENTREP="BATCH" RQT_ENTREP=NoRequête adonix -a -l LANGUE </tmp/serveur.ent >>/tmp/NoRequête.log 2>&1