Search

Prerequisites: None.

Minimum Futurama Version to be used: 3.2

Learning goal: Getting acquainted with Futurama, some of the windows, different kinds of objects en creating a simple formula.

  • In the Windows Explorer create in the Futurama directory a new directory called "Sum". This is the directory where our project will be stored.
  • Open the Futurama Editor.
  • Click on File » New, on in the toolbar or press CTRL+N. An object appears in the Document Explorer dubbed 'New Item'. This object is a Document and serves as the starting point for a typical Futurama project. All other objects will be placed beneath the Document.
  • Save this document as "calc.xml" in the directory "Sum".
  • Go to the Properties window.
  • First we give the document a proper name. Select the property "(Name)" and change 'New Item' to 'The first sum'. It is also possible to do this by doing a right-click on the document and selecting Rename in the appearing context menu. Even faster is simply pressing F2.
  • Now select the Design window and do a right-click. Select New » Node. In the Document Explorer you can see that a node 'New Item' has appeared beneath 'The first sum'.
  • Analog to renaming the document, rename the node 'sum'.
  • Now first select document 'The first sum' and after that the node 'sum'. The Design window will now be blanc.
  • Select the Design window and do a right-click.
  • Select New » Fixed. In the Document Explorer you can see that a Fixed 'New Item' has appeared beneath 'sum'. If you have accidentally created a Fixed in the document itself you can easily remove it by doing a right-click on the Fixed and then select Delete. Alternatively you can use the button in the toolbar to the same effect.
  • Rename the Fixed 'New Item' to 'Parameter A'.
  • The property "Type" of a Fixed indicates what kind of Fixed it is. There are five types of Fixed:  Long (integers), Double (real numbers), Date, Boolean (True/False) and String (any text). Select the type "double" by clicking on the arrow to the right-hand side or by doubleclicking on long itself.
  • Select the property "Text" and click on the appearing button . A popup window appears like the one below. Select '+', '15' en '39' in the respective inputfields (see below). After that select OK. It is also possible to get access to this screen by doing a right-click on the Fixed and select Edit in the context menu.

  • In either the Document Explorer or the Design window select 'Parameter A', do a right-click and select Copy or press in the toolbar.
  • In the Document Explorer select 'sum', do a right-click and select Paste or press in the toolbar. Beneath 'Parameter A' a new Fixed 'Parameter A(1)' appears. Copying objects like this is an alternative to creating objects through New, like we did before and is particularly useful when working with more complex objects like Formulas. Rename 'Parameter A(1)' to 'Parameter B' and assign it the value - 7,34 in the same way we assigned a value to 'Parameter A'.
  • Now define in the Design window through New » Formula an object of the type Formula. With this formula we will add both already defined parameters.
  • Rename the created Formula to 'sum'.
  • We are now going to edit the Formula. Select the property "Text" and click on the appearing button (or use Edit in the context menu) after which the following window will pop up.

  • Click on "Selecteer een formule" (which means "Select a formula"), move the mousepointer to Math » Add and select this one.


 

  • The Window now looks like the one below. The name of the formula is shown as well as the description ("Omschrijving"). We also see Number1. This is the first argument of the sum.

  • Click on the utmost right button. A context menu appears in which we can choose what kind of argument we would like to include. We can choose for example for again a fixed value (Fixed), another formula (Formula) or a reference to an already existing object (Reference). We choose the latter, for we want to add objects 'Parameter A' and 'Parameter B'.
  • Select Reference. Notice that instantly a new argument Number2 has appeared.
  • We now have to create the Reference. To do this click on and search for 'Parameter A'. You'll find that you can’t find it! The reason for this is that 'Parameter A' and 'Parameter B' have the type double while the formula 'sum' has type long and therefore expects arguments of the same type. We therefore have to adjust the type of the formula 'sum'.
  • Click twice on Cancel to leave the "Define Formula" window.
  • Change the type of 'sum' from long to double by clicking on the arrow to the right-hand side or by doubleclicking on long itself.
  • Open the "Define Formula" window once more and select "Selecteer een formule". You can see now that there are two Math » Add possible: one to add arguments of type long and one to add arguments of type double. We need the latter.
  • Select "Math » Add double".
  • Again click on the utmost right button, select Reference, click on and try to find 'Parameter A'. You'll see it now.
  • Select the parameter and click OK.
  • Repeat the same steps for Number2 to create a Reference to 'Parameter B'. Click OK to leave the "Define Formula" window.

In the Futurama Editor we can now see the following. The property "Text" shows that the sum is defined as "Parameter A + Parameter B". The same can be seen in the Design Window in which we can also see the values of 'Parameter A' and 'Parameter B' in de column Value.

image

 

  • Now select the Dependencies window which is right next to the Design window. Here the following can be seen:


 

The formula 'sum' has, as can be expected, Parameters A en B as determinants. The result of 'sum' itself is not used by another object, which explains the empty Dependants window.

  • Doubleclick in the Determinants window on Parameter A. We now 'jump' to this parameter. It can be seen that the Determinants window is empty now, which is always the case with a Fixed. We can also verify that 'sum' is a Dependant of the parameter.
  • Doubleclick once more on 'sum' to return to this object.

The final thing we want to do is to verify the value of 'sum'. to do this, go to the Result window in the lower left of the screen. If the checkbox "auto" is checked, the value 8,05 will appear in the window. If the checkbox is not checked, there will be a button "Evaluate" on which we have to click to obtain the value.

 

A complete example of this exercise can be downloaded here: De eerste sum. Note that this example is created in version 3.2 of Futurama. Opening this example in a newer version of Futurama will prompt Futurama to update the example to the newer version. Click OK when this message appears.