How Do I Create Logic in a Task? (Magic xpa 3.x)
The logic in a task is entered in the Logic Editor. Clicking on the Logic tab will get you there.
Task logic is held in blocks of code called logic units. A logic unit consists of a header line, which represents a handler, and zero or more detail lines, which represent operations.
The handler itself is non-procedural. That is, it is triggered in response to some event, not according to its location in the Logic Editor.
The operations within a logic unit, however, are in fact procedural, and execute from top to bottom. These operations are the “code” that executes in your Magic xpa program. They are very powerful, and you will notice that it takes far fewer “lines” to do work than you may be used to in other languages.
-
Inside the Logic Editor, move to the line where you want to create the header.
-
Press Ctrl+H to create a header line.
-
Select the type of header you want: Task, Record, Variable, Control, Event, or Function.
-
Continue entering the header properties depending on the type of header.
-
Now, inside your logic unit, press F4 to continue adding operations to your procedural logic. Every operation is entered a little differently, but there is context sensitive help to get you going. The operations are covered in an overview in the How Do I Create Operations in a Task? topic.
The Online and Rich Client Samples projects (program TS20 and RTS20)