Announcement

Collapse
No announcement yet.

Debug with formula window

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

  • Debug with formula window

    Is there a way to copy or print debug information sent to the formula window for latter analyses?

    I also tried writing to a file with append, opening at the beginning of the function then closing at the end. In the end I only got one line of information and it was the last one?

  • #2
    Hello danderson,

    Please visit the following thread. There is some good information here that will show you how to write to a text file.

    http://forum.esignal.com/showthread.php?s=&threadid=823

    Regards,
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment


    • #3
      If you look in youe eSignal directory, there is a file called: "formulaoutput" that will have the latest info that was output to the formula output window.

      About writing to a file. While it is possible to do an open with append and then a write in the body of main(), it is much easier to code correctly an open in preMain() and the do the writes in main.

      Don't forget to keep the file handle (sorry too used to C...) in the local global space (ie: Outside of and function calls such as main() or preMain().

      G
      Garth

      Comment


      • #4
        I currently do something like this

        var f1; //used for the output file
        var Log1;

        function main(){

        today = new Date;
        my_day = today.getDate();
        my_month = today.getMonth() + 1;
        my_year = today.getFullYear();
        // FILENAME WILL LOOK LIKE ES-MM-DD-YYYY.txt
        Log1 = sym+"-"+ my_month + "-" + my_day + "-" + my_year+".txt";
        f1 = new File(Log1); // PUT IT IN FORMULA OUTPUT
        f1.open("a+");

        if(!f1.isOpen()){
        debugPrintln("*** Couldn't open TRADE LOG!");
        }else{
        debugPrintln("*** "+sym+" TRADE LOG OPEN");
        }
        curtext = " TRADE LOG OPEN";
        Write2FandE();
        return;


        function Write2FandE(){
        today =new Date;
        CurHours =today.getHours();
        CurMinutes=today.getMinutes();
        CurSeconds=today.getSeconds();

        if(CurHours <10){
        CurHours ="0"+CurHours ;
        }

        if(CurMinutes<10){
        CurMinutes="0"+CurMinutes;
        }

        if(CurSeconds<10){
        CurSeconds="0"+CurSeconds;
        }

        vString = CurHours+"."+CurMinutes+"."+CurSeconds+"."+sym+"." +curtext;

        debugPrintln(vString);
        f1.writeln(vString);

        if(Alert=="ON"){
        dots5.call("SetEmailDefaults","mail.attbi.com","Tr ader","[email protected]","");
        dots5.call("EmailAlert","",vString,sym);
        }
        return;
        }

        Comment

        Working...
        X