Programming

iCALCULA provides essentials procedures for user function programming.  |Prog| key enters User Functions List. Before you have programmed new functions, this list is empty and there is only a |NEW USER FUNCION| available key.  User functions have a customizable name to be identified. If you press a user function name, it runs like any another function in iCALCULA. Along with the name of the user function there is a right accessory icon that enters Function Editing Window.


USER FUNCTION INITIALIZATION

Pressing |NEW USER FUNCION| key, a new empty Unser Function is created and added to the function list. You can begin programming or editing by pressing accessory icon. You can also delete a user function by swiping the list row to the left until a |Delete| button appears.


USER FUNCTION PROGRAMMING

You can enter Function Editing Mode through the right accessory icon of a function of the list. At the top of the Function Editing Window there is a label with the configurable name of the function. You can touch in the label to change its default name. Below there are three buttons |REC|, |STOP REC|, |RUN|, which control user function editing flow. It works like a macro recorder. When you press |REC| button you activate the recording mode which is indicated by a red background. In this mode you can operate with the calculator in the usual way, but all the instructions are stored in a list that is visible when you press |Prog| key while recording is active. |STOP REC| button ends recording mode. Stored instructions remain within the programmed user function for later use and are listed at the bottom of the Function Editing Window.

Data management during function recording is as in normal operation mode. However, two special data entities are available for using with programmable functions:

  • X Variable Register: In the moment you press |REC| button for function editing, the value of x-register is stored in a special register named X Variable where it remains during recording mode. While in this mode you can restore its value into the x-register by pressing |Prog| button and then the |X variable| button situated below |REC|, |STOP REC|, and |RUN| buttons. iCALCULA's numerical integration and root finding routines are based on user functions that utilize this X Variable register as container for the independent variable of the function.
  • Function Parameters: A function definition can include a set of arbitrary named parameters which are listed just below the |X variable| button.  A parameter is a special register which can be loaded with the content of x-register, during normal calculator mode, by pressing the |LOAD| button at the right of the corresponding row in the parameter list. While in recording mode, you can access the value of a parameter by pressing |Prog| button and then the desired parameter in the list. Parameter list allows then a kind of configuration of a function without the need of re-editing it each time. The first time you edit a user function, there are no parameters in the list. There is a |NEW PARAMETER| button that adds a new parameter each time it is pressed during normal mode operation. In each parameter row appear a customizable name and its value, which is initially set to 0. You can edit the name of the parameter by touching in its default name. For deleting a parameter in the list you must swipe its row to the left until a |Delete| button appears.


USER FUNCTION EDITING

Function Editing Window shows at its bottom the instruction list that defines the user function operation. Each row in the list represents a particular instruction. During normal calculator mode and while in this window, your can select an instruction by touching its corresponding row, or deleting it by swiping its row to the left until |Delete| button appears.  A |CLEAR ALL| button situated at the top of the instruction list delete all the rows of the list at a time. Each time you enter recording mode by pressing |REC| button while in normal mode, the instruction list is modified. The way this list is modified can be altered by the position of the |INSERT/DELETE| button. Following situations are feasible:


  • Empty instruction list: Next time you enter recording mode, the instruction list will be populated. Position of the |INSERT/DELETE| button is irrelevant in this situation.
  • Non empty instruction list and |INSERT| button active: If no row in the instruction list is selected, new instructions will be added at the end of the list each time recording mode is entered. If you select an instruction row before entering recording mode, new instructions will be inserted afterwards and the previously existing will be displaced.
  • Non empty instruction list and |DELETE| button active: If no row in the instruction list is selected, new instructions will be added at the end of the list each time recording mode is entered. If you select an instruction row before entering recording mode, new instructions will be inserted afterwards substituting the previous ones.

No hay comentarios:

Publicar un comentario