MYOB Exo Clarity

Hide NavigationShow Navigation

  • Contents
  • Index
  • Search
 
Display results with all search words

 

Programming Basics

Exo Clarity uses a small subset of the Delphi programming language. While limited in one sense, this subset still allows you to perform complex calculations, string manipulation, database interaction as well as many built-in Exo Business-specific functions.

In order to use the Calc tab effectively, it is important for you to become familiar with a few concepts.

Data Types

There are several fundamental data types used in databases and programming, but we will only describe five main ones here very briefly. 

Integers are whole numbers with no decimal portion, for example, an account number. 

Floating Point numbers (or “Floats”) are like integers, but they do allow numbers after the decimal point, for example, an amount field.  You may see floats being called “Extended” in Exo Clarity.

Boolean values have two possible values, True or False (or on/off, 1/0, Y/N - they are all just representations of the same thing).

Date / DateTime these data types store years, months, days, and for DateTime hours, minutes, seconds and fractions of a second. Sometimes you only need to work with a date (you can use “Date”); other times you only need to work with a time (You can use “DateTime”, and the date part will be irrelevant). 

Strings are just text. Even if you have a string with some numbers in it, you can't do any mathematical operations on the numbers without forcing the computer to interpret it as such. Look at some of the conversion functions to convert string values if you need to.

Objects

In the simplest sense, Objects are just abstract entities that represent "things". Your report is an object. A label on your report is an object. A picture on your report is an object. Lines, regions and anything else that make up your report are also objects.

Properties

Objects have properties that either store information about the object, or determine how they look or behave. For example, your report has a property called PageNo that can be used by your code at any time during the generation of the report to tell you which page it is currently on. Be aware that properties also have a data type associated with them.

Events

Objects also have events tied to them. Events are granular steps in the generation of your report, and each time an event happens, an "event handler" is run if it exists. Event handlers are pieces of code that tell Exo Clarity what to do when the event happens. An example of an event is a label's "OnGetText" event, which allows you to manipulate the label text at runtime. You might add an event handler to change the label text based on some other parameter, or to update a counter.

Variables

In Exo Clarity the term "variable" applies to two different things:

  • A component that you can add to your canvas from the Standard Components toolbar.
  • A value that is defined and manipulated by code in the report. This value can be a counter, a text string, or a list of strings. If you want to display the value of the variable in the report, you need to manually assign it to an existing component on the report, such as a label. Like Object properties, variables also have a data type associated with them.

Note: You can set up global variables on the Calc Tab - these are available everywhere from anywhere in the report, which means they can be used in any functions or procedures. It also means they can be passed between the main report and any sub reports.