Startup
Macro
The Startup macro/script is unique.
It is the first thing that runs when Newlook starts up. Typically it is used for initialization, from connecting to
a specific connection definition, through to setting session variables
and specifying the master form for the session (if one exists).
There can only be one Startup
macro or script for each project.
Creating a startup macro
- Select Logic (
) from the developer
bar.
- Click the Macros
button.
- Click the New
button at the bottom of the screen.
- In the Properties
pane on the left hand side, position your cursor in the Name
field and enter the name Startup.
- Enter the relevant Labels,
Conditions and Actions as desired.
- When complete click the
Save button (
) to save your macro.
Some common reasons for using a startup macro
- Connecting to a host
application - the Connect
action can be used to initiate a connection upon startup.
- Initializing session
variables - the SetValue
action can be used to set any global variables that are going to be used
in the session.
- Specifying a Master
Form - The SetValue
action can be used to specify the master form applied to the session. The following syntax will load a master form named My master Form:
SetValue
App.masterform "My Master Form
Startup macro vrs command line Run Macro command
In the event that you have a startup macro and you are using the -r
(run macro) command or - c (connect) command on the shortcut property for Smartclient (or the Start Macro or Connection Name Startup preferences in Server) then the
macro specified in the -r
or the connection specified -c
command will take precedence over the startup
macro. In this scenario the startup macro will not run. This can be useful
if you wish to specify different startup conditions for different users.
See Also
Writing Macros