Print Page | Close Window

BullScript bracket matching

Printed From: BullCharts Forum
Category: BullCharts
Forum Name: Tips and Tricks
Forum Discription: Tips on how to use BullCharts more effectively.
URL: http://www.bullcharts.com.au/forum/forum_posts.asp?TID=185
Printed Date: 18 May 2024 at 7:52pm
Software Version: Web Wiz Forums 9.69 - http://www.webwizforums.com


Topic: BullScript bracket matching
Posted By: Peter
Subject: BullScript bracket matching
Date 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.



Print Page | Close Window

Bulletin Board Software by Web Wiz Forums® version 9.69 - http://www.webwizforums.com
Copyright ©2001-2010 Web Wiz - http://www.webwiz.co.uk