Instructions are operations to be performed by MakerPlot-J. A number of instructions can be used to create code, such as event code to be ran when a button is clicked for example.
Instructions always begin with an exclamation point (!). An instruction could be to change a property of a control, perform an operation such as loading a new interface, creating a control, performing a conditional operation, or having a control's instruction run.
Multiple instructions may be on a single line by separating them with a semi-colon (;). There is no need to place a semi-colon at the end of a single instruction line.
Using the Debug/CLI Window (F4) is a great way to test incoming data with your interface or testing features such as instructions and getting help on them. It provides help on instructions and allows contextual auto-complete by typing a few letters, then using CTRL-Space to auto complete. Help can also be viewed by selecting and right-clicking an item in the list, or entering an instruction and typing F1.
The Code Editor Window also provides similar features to help in writing event code.
Instructions can come from the Debug/CLI window, a control's Event Code, from a connected microcontroller or from a Macro file.
General Instructions
Intrinsic, or operating from the Main Interface, cover a wide range of functions, such as:
•Taking snapshot images of the interface
•Opening an Interface
•Opening a file using system associations
•Writing data to file
•Deleting drawings
•Manually running the main interface's event code
•Using dialog boxes for user interactions
•Working with the Processing Queue
•Performing conditional operations
•Making and placing controls on the interface
•Making Variables
Examples:
!makeTextBox txtTest,10,10,20,5,Test
!bell
!if 10 = 9 !then !bell !else !dialogInfo They are not equal\nThank you!
!makeVar varTest=50
Control Instructions
Controls have instructions as well, such as txtTest created above. Entering !txtText. will list the control's instructions and properties.
All controls have the following instructions:
•run - runs the control's event code manually !txtTest.run
•runUpdate - Processes the Update Value for the control.
•bounds - sets the left, top, wdith and height of the control !txtTest.bounds 20,20,30,10
•clearCode - Clears the event code of the control
In this example, the textbox also has a clear instruction which clears its contents.
Property Instructions
Properties of interfaces and controls are also access as instructions for changing their values, such as for txtTest. Note the current value of the property is displayed to the right in the Debug/CLI. Select and right-click or enter and press F1 for more help.
!txtTest.text = Hello World! // As .text is also the default property, you may use !txtTest=Hello World!
!txtTest.backColor=RED
Variable Instructions
Creating or assigning variables is also treated as instructions. It's recommended to start a variable with var to identify it easier and prevent conflicts with properties such as height (so use varHeight).
!makeVar varTest1 !makeVar varTest2 !varTest1 == 100 ? [varTest1] !varTest2 = Hello ? [varTest2]
Please see Variables for more information.
Multiple Instructions per line
Multiple instructions can be on a single line or within a !then or !else by separating by a semi-colon.
!bell; !txtTest.clear
!if [varTest1] == 10 !then !bell; !debug it's equal!
|