Announcement

Collapse
No announcement yet.

how to use askForInput()?

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

  • how to use askForInput()?

    Can someone give me a working example of how to use askForInput()? I am trying to find a convenient way to input some parameters without going through the study editing window. I am trying to create a few buttons on the chart and associate efs functions to them so that when I click on a button a window would pop up and accept my input. However I can not even get askForInput to work. Any help is appreciated.

  • #2
    clearpicks
    The enclosed example will use askForInput() both when the efs is first loaded and when you click the TEST button.
    See also the comments in the script
    Alex

    PHP Code:
    function preMain() {
        
    setPriceStudy(true);
        
    setShowCursorLabel(false);
        
    askForInput();//remove this if you don't want the Study Properties when first loaded
    }

    function 
    main(Length) {
        
    drawTextRelative(3,15," TEST "+"@URL=EFS:Test",Color.black,Color.yellow,
                        
    Text.RELATIVETOLEFT|Text.RELATIVETOBOTTOM|Text.BOLD|Text.FRAME,
                        
    "Arial",10,"Test");
        return ;
    }

    function 
    Test(){
        
    preMain();
        
    //or if you don't want askForInput() in preMain just call it here and remove the line above
        //askForInput();

    Comment

    Working...
    X