Hi please help, i am note fine with the syntax from javascript. Can someone check what is wrong with my code. I like to copy the value from MsgArray0.EventID or MsgArray1.EventID to Dialog.EventID depending the rocket button value Dialog.ArrayIndex.
(function () {
var MODULE_NAME = "SelectDialogArray",
ENABLE_LOGGING = true,
RECORD_LOG = false,
logger = shmi.requires("visuals.tools.logging").createLogger(MODULE_NAME, ENABLE_LOGGING, RECORD_LOG),
fLog = logger.fLog,
log = logger.log,
module = shmi.pkg( MODULE_NAME );
// MODULE CODE - START
/* private variables */
/* private functions */
/**
* Implements local-script run function.
*
* This function will be called each time a local-script will be enabled.
*
* @param {LocalScript} self instance reference of local-script control
*/
module.run = function (self) {
//Place your Code here
if (Dialog.ArrayIndex == 0) {
setitemValue(Dialog.EventID,MSGArray0.EventID);
}
if (Dialog.ArrayIndex == 1) {
setitemValue(Dialog.EventID,MSGArray1.EventID);
}
/* called when this local-script is disabled */
self.onDisable = function () {
self.run = false; /* from original .onDisable function of LocalScript control */
};
};
// MODULE CODE - END
fLog("module loaded");
})();
... View more