Macro Builder/Editor
Home ] Up ] Plot Window ] Configuration Options ] Values Form ] Messages Form ] Log-Debug Form ] Player Form ] Plot Object Editor ] [ Macro Builder/Editor ]

The object editor is used to construct macros from the current configuration, to open existing macros, to save and run macros.

Note: StampPlot does not recognize when you change the configuration or load new macros from the main form.  This makes it easy to not save final configurations, to update from incorrect configurations, and to forget to save before exiting StampPlot.  Be cautious that you are updating from the correct configurations and updating and saving as you develop.

The general sections are:

bulletToolbar
bulletCode Sections for selecting the area of code to work on.
bulletProgram Header for entering development information, name, date, etc.
bulletCode entry areas for each section.
bulletAt the bottom is an immediate text box for entering code to test directly and a error message box (blue).

Toolbar:

bulletStart a new macro
bulletOpen an existing macro
bulletSave and Save-As for existing macro.

bulletRun currently open macro - Runs the saved current macro open in the editor.  If changes have been made, save before running.
bulletBuild Macro: Builds the Init, Objects, Menu Buttons, Drawings and Variables from the current plot configurations.  Any manual changes to these areas will be overwritten. 
 

Code Sections:

Init: (shown above)

bulletCreates an Init: routine for the macro.  The current plot configuration is analyzed, and along with the check-box input on the form, an initialization routine is created.
bulletThis area is updated by either using the Build Macro button, or using the 'Update from Current' button which affects only the Init area.
bulletIf default, dblClick, reset or timer routines have been entered, their corresponding instructions (!USED ON) will be added. 
NOTES:  
bulletUse of these routines is currently discouraged.  Similar results can more effectively be produced using the Plot Objects.
bulletChanges to other routines may require updating this section, such as adding code to any empty routines or selection options under those areas.  Manual modifications to this section are recommended to be performed last after updating this section.. 
bulletThe current code in the text area can be tested using the Test Code button.

 Objects Section:

bulletThis area contains configuration information for the plot objects currently configured in StampPlot.
bulletThis area is cleared and built when the toolbar button is used or the Update button is clicked.
bulletCode may be manually modified and tested.
bulletSet Application Percent size percent adds the !APPS instruction to set the application percent on the desktop.
bulletEvent code with more than one line is separated by (;) and a carriage return for easier reading.
bulletPaths to files, media and macros will be replaced dependent on their locations.  When using Save As, StampPlot may inform you that Paths need to be rebuilt.  Allow it to do so in most cases. Please see the discussion on Developing Macros for more information.

Macro Buttons Section:

bulletThis section displays the current configuration of the user defined macro menu/buttons.
bulletSelect 'Save Buttons to Macro' to include the configuration in your macro.
bulletManually modify and test changes.
bulletUpdate from current button configuration.

Constant Drawings:

Constant Drawing are lines, images, etc which are draw on the plot itself, a plotting object, or the object background.

bulletIf your plot has constant drawings (@), they will be shown here.
bulletYou may manually add and test constant drawings.

bulletVariables Routine is for defining variables, or data markers, used in the macro.  When code is entered in this section, a macro call is added to the Init routine when it is updated.
bulletThe Default Routine is discussed under Macro Events.   It is ran when ever analog data arrives , or when using the default routine when analog data arrives (!USEM ON).  When code is entered in this section, a !USED ON is added to the Init routine when it is updated.
bulletThe Reset Routine is discussed under Macro Events.   It is ran when the plot is reset.  When code is entered in this section, a !USER ON is added to the Init routine when it is updated.
bulletThe DblCLick Routine is discussed under Macro Events.   It is ran when the plot is itself is double-clicked.  When code is entered in this section, a !USEC ON is added to the Init routine when it is updated.
bulletThe  Timer Routine is discussed under Macro Events.   It is ran when at defined intervals similar to the Object Timer.   When code is entered in this section, a !USET ON is added to the Init routine when it is updated.  The interval is defined by INTT value from 0 to 60 seconds.
bulletThe User Defined Routines allow a section to construct your own routines for calling.  All routines must begin with a routine name and end with ENDMAC
ShowTime:
!STAT (RTIME)
ENDMAC

The routine may be called by
!MACR macro_name.routine_name
or, if called within the same macro
!MACR .routine_name
!MACR .Showtime

Please see Macro Basics for more information on writing macros.