Algosim documentation: Front end events

Front end events

You may specify an Algosim program that executes automatically when Algosim starts. This program may, for instance, define variables and functions you would like to be available by default.

To use such a start-up script, simply save it as startup.prg in your Algosim program directory:

C:\Users\<User name>\AppData\Roaming\startup.prg

Similarly, you may choose to define a script that runs automatically when the front end is to be closed. This program is named exit.prg:

C:\Users\<User name>\AppData\Roaming\exit.prg

If this program returns false, the front end will not close. Hence, you may use a script like the following to display a confirmation dialog box:

MessageBox("Do you want to exit Algosim?", '("&Yes", "&No"), "Yes", "No") = "Yes"

The best way to create and edit these scripts is to use the Program editor. To create one of these scripts, press Ctrl+N to create a new program and then save it as either startup.prg or exit.prg. To open one of these, press Ctrl+O.