Announcement

Collapse
No announcement yet.

FunctionParameter.BOOLEAN

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

  • FunctionParameter.BOOLEAN

    Okay: What am I doing wrong? I've cut the code down to the bare bones to show you my problem. Very simple. Save this code as anything (say test.efs) and then load it into a chart:

    var init = true;
    function preMain() {
    var x = new FunctionParameter("TP", FunctionParameter.BOOLEAN);
    with(x) {
    setName("Test Param");
    setDefault(true);
    }
    init = true;
    }
    function main(TP) {
    if(init) {
    debugPrintln("TP is: " + TP);
    if(TP) {
    debugPrintln("TP in true condition");
    }
    else {
    debugPrintln("TP in false condition");
    }
    init = false;
    }
    }

    Now in the output window after loading the script and then right clicking the advanced chart and changing the single parameter to false I get:

    TP is: true
    TP in true condition
    TP is: fase
    TP in true condition

    In other words, even though TP appears to be "false" it doesn't go into the false part of the clause. I've also attached the file to this message. Please could someone else also load this and let me know if I've done something stupid. I can't see what I've done wrong here...?

    Many thanks
    Attached Files
    Standing on the shoulders of giants.

  • #2
    wildfiction,

    It's an eSignal bug. The paramter is passed as a string and not a bool.

    So you aren't doing anything wrong...other than the fact you didn't search the message board before posting the question ;-)

    This one has gotten more than a few people, but at least it is easy to work around.

    Garth
    Garth

    Comment


    • #3
      Thanks Garth,

      I actually spent a fair amount of time searching the "Knowledge Base" but the answer wasn't there. I'm not sure if eSignal should continue to call it the "Knowledge Base."

      I will search here in the future as well. Thanks for your time and effort in answering.
      Standing on the shoulders of giants.

      Comment

      Working...
      X