Announcement

Collapse
No announcement yet.

FunctionParameter - Bug?

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

  • FunctionParameter - Bug?

    The efs below does not work after editing (with Edit Studies) from false to true. Could there be a problem with the BOOLEAN FunctionParameter?
    I use version 7.3 Build 588.




    function preMain() {




    var fp1 = new FunctionParameter("bInput", FunctionParameter.BOOLEAN);

    fp1.setName("Choose");
    fp1.setDefault(false);


    }



    function main(bInput) {

    if(getCurrentBarIndex() == 0) {

    if (bInput == false) {
    debugPrintln("False");
    } else if (bInput == true) {
    debugPrintln("True");
    }

    }

    return null;
    }

  • #2
    Try it this way (note the quotes as well):

    fp1.addOption("true");
    fp1.addOption("false");
    fp1.setDefault("false");


    Garth
    Garth

    Comment


    • #3
      Garth

      Thanks for your reply. It looks you convert the whole thing to strings.
      Does this mean the boolean version does not function?

      Traveller

      Comment


      • #4
        Hi,

        No the Boolean works.

        var fp1 = new FunctionParameter("TrueFlase", FunctionParameter.BOOLEAN);

        fp1.setName("TrueFalse Test");
        fp1.setDefault(true);

        will work. At least it does on Build 602.

        Garth
        Garth

        Comment

        Working...
        X