I run an efs that executes a custom ....efsLib (CSTMSOUND MENU SETGLOBAL ARRAY.EFSLIB) which creates some global variables via "setGlobalValue(...)" and works fine in ver 10.6 but in ver11 even though the function in the ...efsLib executes, the "getGlobalValue(....) in "Call_Lib_Test.efs" returns the error ""line 6: undefined function call", i.e., " var t2 = t1.gSoundList();"
".
Any ideas?
This efs calls the ...efsLib file
This is the ...efsLib file:
Thanks,
Wayne
".
Any ideas?
This efs calls the ...efsLib file
PHP Code:
//File name: "Call_Lib_Test.efs"
var aFPArray = new Array();
if(getGlobalValue("SoundListID1") == null){debugPrintln("it ran");
var t1 = addLibrary("cstmSound Menu setGlobal Array.efsLib"); // Library declaration, outside main
var t2 = t1.gSoundList(); // runs the gSoundList() function to setGlobalValues(...)
//returns error: "line 6: undefined function call"
}
var SoundArray = getGlobalValue("SoundListID1");////see companion file named: "Sound Menu setGlobal Array.efs"
var vLineCtr = getGlobalValue("SoundListNo1");
debugPrintln("MACD t1: " + (t1 = null));
debugPrintln("SoundArray: " + SoundArray[0]);
debugPrintln("vLineCtr: " + vLineCtr + (vLineCtr == null));
function preMain() {
//setStudyTitle("sample");
setShowTitleParameters(false);
var x=0;
var j=0;
aFPArray[x] = new FunctionParameter("iAlertUp", FunctionParameter.STRING);
with(aFPArray[x++]){
addOption("None");
for (j = 0; j < vLineCtr; ++j) {
addOption(SoundArray[j]);
}
setDefault( "None" );
}
aFPArray[x] = new FunctionParameter("iAlertDn", FunctionParameter.STRING);
with(aFPArray[x++]){
setName("Down Sound Alert");
addOption("None");
for (j = 0; j < vLineCtr; ++j) {
addOption(SoundArray[j]);
}
setDefault( "None" );
}
}
function main(iAlertUp,iAlertDn){
}
PHP Code:
//File name: "CSTMSOUND MENU SETGLOBAL ARRAY.EFSLIB"
//see companion file named: "Call_Lib_Test.efs"
var WavFileArray = new Array();
var wbInit = false;
var vLineCtr = 0;
function gSoundList(){
//path can be determined by uncommenting the next line of code:
//debugPrint( "Your Sound Files folder is located here: " + getSoundFileRoot() + "\n" );
//to update the sound file list run the "...path/ListSoundFiles.bat"
//if it doesn't exist then determine the sound file path (use the "getSoundFileRoot()" command in an efs to find it), then
//open create a file named "ListSoundfiles.bat" using notepad.exe and place the following DOS code in the body of the document
//[dir "c:\program files (x86)\esignal\sounds" /O:N /B > SoundFileList.txt] without the [] brackets. Replace the path enclosed in
//quotes with the path shown by running the "getSoundFileRoot()" command
//remember: the path in the "ListSoundfiles.bat" code must be the same as the "getSoundFileRoot()" path
if(!wbInit){
var xData;
var fName = "SoundFileList.txt";
var a = new File(fName); //the file will be created in: eSignal/FormulaOutput/
if (a.exists()) {
a.open("rt");
if (a.isOpen()) {
a.setPosition(0);
while(!a.eof()){
xData = a.readln();
WavFileArray[vLineCtr] = xData;
vLineCtr+= 1;//counts the # of lines in the file
}
a.close();
}
}
wbInit = true;
}
setGlobalValue("SoundListID1", WavFileArray);
setGlobalValue("SoundListNo1", vLineCtr);
}
Wayne
Comment