Calculations

Tables

Blockpad supports tables that act like mini-spreadsheets inside of a document. You can use normal Blockpad formulas in the table, and reference values back and forth between the table and report.

Insert a mini-spreadsheet table:
  1. While in a [report], click the Insert Table button in the toolbar.
  2. Click OK./li>

You can use all of the Blockpad formula features inside of a table, including units, naming values, and creating functions.

To reference values in the table, you can use clicking like in a spreadsheet or any other referencing method. Notice the table name appears in front of the value. This is because a table is a [frame] that [contains values].

You can change a table's name so that a useful name appears in the formula.

  1. Select the table by clicking on the label.
  2. Open the [properties window].
  3. Under Object, click Name.
  4. Type in the new name.
  5. Press enter.

Referencing works both ways. You can reference document values from inside a table too.

Multiline cells

You can also have a word processor style table cell, called a multiline cell. Multiline cells act a lot like a document, so you can do all the same things, like format text, equations with math notation, and more.

Change a cell to multiline:
  1. Select the cell or cells.
  2. In the toolbar, change Value Cell to Multiline.

(To change a cell width, you can use the [properties window] or show rulers (View>Show Rulers) and drag the borders of the ruler.)

A multiline cell is considered to be a [frame], like a table. You don't need to specify the name in front of references because [capture values] is set to no by default.

In a report, you may often want all of the cells in a table to be multiline. Do this automatically by selecting word processing mode when you insert a table.

Insert a word processor style table:
  1. While in a [report], click the Insert Table button in the toolbar.
  2. In the window that appears, change Mode to Word Processing Mode.
  3. Click OK.

Fields

Fields act like spreadsheet cells, but in a document. You can have formulas in them like a dynamic equation, but the formatting is more similar to a spreadsheet cell.

Functions

In Blockpad, you can use functions inside of formulas/dynamic equations, just like in a spreadsheet. There are a lot of built in functions, but it's also easy to make your own functions.

There are basic math functions.

Functions will track units.

Functions that require angles are unit sensitive.

There are logical functions.

The expression above uses the if() function. It's shown in the display form.

A quick note on logical functions: to test if something is equal, a double equals sign is used (==).

There are also text functions and lookup functions for use with spreadsheets and tables.

Check out the [math], [text], [logic], and [lookup] libraries for the basic built in functions in Blockpad.

Create your own function

Custom functions are simple and accessible in Blockpad - you can create them in a normal formula.

To define a function, specify the function name, the function variables, and the calculation. Let's look at the sample below.

In the first dynamic equation, "hypotenuse" is the function name, "A" and "B" are the function variables, and Sqrt(A^2 + B^2) is the calculation. Now hypotenuse() is defined as a function, and you can use it in calculations. In the second equation, hypotenuse is used as a function and calculates the inputs 3 ft and 5 ft.

Create your own function
  1. Type in the function name.
  2. Type in open and closed parentheses.
  3. Inside of the parentheses, type in the function variables.
    1. Variables are separated by a comma.
    2. Variables are in the order that you will select them when using the function later.
  4. Type an equals sign.
  5. Type the function calculation like any other calculation, but use the function variables where you want them.

Using a defined function is very similar to referencing a value: clicking, copy reference, or typing the name in all work. Then proceed like a normal built-in function, with parentheses and values for the function variables.

A few things to remember:

  • Function names and function variable names follow the same rules as [value names] (can't start with a number, etc.).
  • Function variable names are local to the function. So, you can use that same name for a value outside of the function, and it won't relate in any way to the function.
  • Functions are stored in Blockpad very similarly to values (functions are actually considered to be "values"). So, referencing values and using a defined function are very similar.
In-line functions

There is another way to define a function, without giving it a name.

To do so, type the function variables in parentheses, an equals sign with a greater than sign, and then the calculation. To use this function, you can use copy reference or clicking and Blockpad will auto-generate a name. For single variable functions, the parentheses can be dropped.

Equation solving

Solver sections make solving systems of equations straight forward. [Check out our video] or learn more in [sections].

Insert a solver section:
  • Select the [solver] button in the toolbar.

To use a solver section, type in dynamic equations that use new variables. You can reference already named values like normal. When there's enough information to solve for the variables, the answers appear at the bottom. You can reference these answers the same way you reference other values in a document.

That's enough to get started with calculations

Click [here] to move on to spreadsheets, or continue to learn more calculation features.