BullCharts Forum Homepage
Forum Home Forum Home > BullCharts > Tips and Tricks
  New Posts New Posts RSS Feed: BullScript bracket matching
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

BullScript bracket matching

 Post Reply Post Reply
Author
Message / View First Unread Post
Peter View Drop Down
BullCharts Staff
BullCharts Staff
Avatar

Joined: 09 Sep 2004
Location: Australia
Posts: 241
Post Options Post Options   Quote Peter Quote  Post ReplyReply Direct Link To This Post Topic: BullScript bracket matching
    Posted: 06 Apr 2005 at 11:24am
Much of the power of BullScript (and most scripting languages) comes from the ability to be able to use the results of one function as the input of another. Ie, putting one function inside another. This is called nesting.

However, nesting can quickly cause a script to become difficult to read, as you can end up with many levels of brackets. The BullScript editor has a bracket matching feature to make it easier to read nested scripts.

When viewing a script, place the cursor just before an opening bracket. The bracket will become pink (or red in ver 2.4.1 or older), and the corresponding closing bracket will also become pink. Alternatively you can place the cursor after the closing bracket to see the starting bracket.



In the example above, the cursor has been placed just after the "if". Notice that the following bracket and the corresponding closing bracket are highlighted.

If the brackets belong to a function, and that function has several parameters, then the commas are also highlighted. This makes it easier to identify what script is being used for each of the parameters.

By looking at the highlighted brackets and commas in the example above, it can be more easily seen that:
  1. V < hist(V,1)   is the condition of the "if" function.
  2. Previous(1000) + (((expr - hist(expr,1)) / hist(expr,1))*Previous(1000))  is the script used if the condition is true.
  3. Previous(1000) is the script used if the condition is false.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.69
Copyright ©2001-2010 Web Wiz