Announcement

Collapse
No announcement yet.

Test for Application Shutdown

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

  • Test for Application Shutdown

    Hi. Is there a way to specifically test for eSignal shutdown within postMain()?

    I maintain a GlobalValue containing a file object pointer that I need to survive between symbol selections in a chart. I would think the file should be closed when eSignal shutsdown, but I see no way to differentiate this in postMain() from just a symbol change.

    Thanks.

    - Ian

  • #2
    Hello Ian,

    postMain() will be called if eSignal is shutdown. If you close your file in postMain() it will be closed upon eSignal shutdown. There isn't any way to differentiate between a symbol change or shutdown, but if you close the file in postMain() your formula logic shouldn't be adversely affected. If you add a global flag to the formula it will get reset upon a symbol change. You can check against the global flag to open your file on the first iteration of main() after the symbol change. Then set the flag to 'true,' which will prevent this code block from executing again until you change the chart symbol again.

    PHP Code:
    var vFlag false;

    function 
    main() {
        if (
    vFlag == false) {
            
    // open file object here
            
    vFlag true;
        }
    }

    function 
    postMain() {
        
    // close file object here

    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
      I keep the file object system global so that I can easily resume file operations at the place in the file where I left off before the symbol change. I'll look into maintaining a (system) global index to the location in the file instead.

      Still would be nice to have a utility function that tests for shutdown. I'll submit a feature request.

      Thanks for the info.

      - Ian

      Comment

      Working...
      X