Announcement

Collapse
No announcement yet.

Help with this ...efsLib is appreciated. It works fine in ver 10.6 but not in ver 11

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help with this ...efsLib is appreciated. It works fine in ver 10.6 but not in ver 11

    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
    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 (
    0vLineCtr; ++j) {
                
    addOption(SoundArray[j]);
            } 
            
    setDefault"None" ); 
        }
        
    aFPArray[x] = new FunctionParameter("iAlertDn"FunctionParameter.STRING);
        
    with(aFPArray[x++]){
            
    setName("Down Sound Alert");
            
    addOption("None");
            for (
    0vLineCtr; ++j) {
                
    addOption(SoundArray[j]);
            } 
            
    setDefault"None" ); 
        }
    }

    function 
    main(iAlertUp,iAlertDn){

    This is the ...efsLib file:
    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 
    = 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);

    Thanks,
    Wayne
    Last edited by waynecd; 01-26-2011, 01:34 AM.

  • #2
    A stupid mistake in line 4 of the first script in my first post was the problem. I used "==" instead of "!=".
    The reason it worked in ver 10.6 is that I had loaded the global varibles so they already existed when I tested out the script. Had I run it upon just opening eSignal it would have failed.

    It should read:

    PHP Code:
    if(getGlobalValue("SoundListID1") != null){debugPrintln("it ran"); 
    Wayne
    Last edited by waynecd; 01-27-2011, 08:41 AM.

    Comment

    Working...
    X