Banana.Script

Questa documentazione è superata

La documentazione più completa e aggiornata è quella di Banana Contabilità Plus: Provalo subito

In this article

Banana.Script represent the interface to the script file and can be accessed through Banana.script. It is used to get the parameters values defined in the script. For example if you want to print out in a report the publishing date of the script.

Properties

Methods

getParamValue(paramName)

Return the value definend in the script file of the parameter paramName. Return an empty string or the internal default value if the parameter is not defined. Return the first found value, if the parameter is defined multiple times.

Banana.script.getParamValue('pubdate'); // returns for example '2016-05-11'

getParamValues(paramName)

Return all the values defined in the script file of the param paramName . Return an empty array if the parameter paramName is not defined.

// Script.js example:
// ...
// @authors = Pinco
// @authors = Pallino
// ...

Banana.script.getParamValues('authors'); // returns ['Pinco', 'Pallino']

getParamLocaleValue(paramName)

Return the localized value definend in the script file of the param paramName. Return an empty string the parameter is not defined.

// Script.js example:
// ...
// @description = English desciption
// @description.it = Descrizione italiana
// @description.de = German Beschreibung
 ...

Banana.script.getParamLocaleValue('description'); // returns 'Descrizione italiana' for a system running with the locale 'italian'.

Condividi questo articolo: Twitter | Facebook | LinkedIn | Email