Contents - Index
Saving User Inputs
Save and Load Inputs buttons can be placed on the Diagram window and/or child Diagram windows by selecting the Add Save (or Load) Inputs buttons in the Diagram window toolbar. Save and Load buttons are normally needed only for Distributable programs, since regular EES programs always save all program information with the normal Save command. The ability to provide Save and Load Inputs buttons on the Diagram window is available only in the Professional version.
The dialog window shown below will appear after clicking the Add Save Inputs button in the Diagram window toolbar.
A similar dialog appears when the Add Load Inputs button is clicked. The dialog allows the caption of the button and its location and size to be specified. A name can be optionally associated with the button. If a name is entered (for example, SaveButton), EES will create variables SaveButton.left, SaveButton.top and SaveButton.hide that can be set in the Equations window, a Checkbox or Radio Group control or a Drop-down list to control the position and visibility of the button. If an array variable is provided, e.g., SaveButton, the created variables will be SaveButton.left, SaveButton.top, SaveButton.hide, and SaveButton.FileName$.)
EES will also create string variable SaveButton.FileName$. This read-only variable contains the complete name (path, filename, and extension) of the file that was last saved (for the Save button) or loaded (for the Load button). The name can be displayed on the Diagram window as text item, just as for other EES variables. Note that the EES string function ShortFileName$ can be used to delete the path information from the filename if desired.
When the user clicks the Save button, a standard file save dialog will appear in which the name of the a file can be entered. The default name is the same name as the EES file with a filename extension of .VAR. The filename and directory information can be changed but the filename extension must be .VAR in order for EES to recognize the file. If confirmed, a file containing the current values of the all EES variables, including the current values of inputs, is written to the disk. This .VAR file can later be loaded with the Load button. A standard file open dialog will appear in which a .VAR file can be selected. The main and child Diagram windows will be updated with the values of the variables found in this file.
When opening one of the EES files contained in the Distributable program, EES will look for a .VAR file in the same directory as the Distributable program with the same parent name as the EES file. If a .VAR file is found with this parent name, automatically loaded and the input information on the Diagram windows will be updated.
The Save button is disabled until calculations have been successfully completed. In this way, it is not possible to write a set of input information that will not successfully calculate. Both the Save and Load buttons will be disabled if the Diagram window does not contain input variables.
The attributes of the Save and Load buttons can be changed by right-clicking or double-clicking on the button and providing the desired information while in development mode.
While in development mode, the Load and Save buttons can be dragged to any location on the window. Finer positioning is available by pressing the left, right, up, or down arrow keys which move the selected button one pixel for each press. The width and height of the button can be changed by holding the Ctrl key down while pressing arrow keys. The right arrow increases the button width by one pixel. Left arrow decreases the width. Down arrow increases the height and up arrow reduces the height.
A picture that is stored in a bitmap (.bmp) or JPEG (.jpg) file can be displayed on the button. The picture option is selected with the drop-down control below the caption. A standard file selection dialog box to facilitate selection of the picture file will appear when the picture option is chosen.