Announcement

Collapse
No announcement yet.

eval

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

  • eval

    is it feasible to use eval to create a return in main based on a user parameter?

    e.g. this study allows the user to set the number of zone lines and then creates a return value based on this.

    Eval.efs

    return eval(ret) returns -100 for some reason?
    Paul Williams
    Strategy & Applications
    www.futurenets.co.uk

  • #2
    Yeah, setting up all of those defaults in your main() is a no-no. They belong in the preMain(). Use the askForInput() function to bring up the Edit Studies panel in your preMain() for the dynamic info you need from the user.

    Comment


    • #3
      ok thanks SteveH have removed all deaults from main in this version (although they appeared to work ok)

      Eval2.efs

      but don't appear to be able to use eval to dynamically create a return in main?
      Paul Williams
      Strategy & Applications
      www.futurenets.co.uk

      Comment


      • #4
        pretty sure now that eval is not the solution. but does anyone know if this can be done and how?
        Paul Williams
        Strategy & Applications
        www.futurenets.co.uk

        Comment


        • #5
          Paul,

          Right, the documentation just states that the default-type functions should be in the preMain(), not that they must. I do know there are some EFS library functions which will appear as formula errors if they're in the main() (but I can't remember ones off the top of my head).

          I'll have a go at trying to get your script to work.

          Comment


          • #6
            Paul,

            I rewrote your script without using eval() in its most basic form. Feel free to embellish it.
            Attached Files

            Comment


            • #7
              excellent Steve. thank you
              Paul Williams
              Strategy & Applications
              www.futurenets.co.uk

              Comment

              Working...
              X