|
||
As of version 2.0, ProPath fully supports and manages multiple data sets.
These can be "Managed Folder Data Sets" (where the folder for each data set is expected to live below the FOLDER:MAINData location) or "Other" data sets that can be in any location (selected via a file dialog).
This feature makes it simple to maintain entirely different sets of data (the most obvious being demo data and regular use data) with almost no work on the part of the developer.
Data sets can be local on the PC or shared on a network (or both).
User settings (such as the current data set and if the Select a Data Set window should be shown on startup) are stored on the local PC.
The list of data sets can be stored in the folder where the data sets reside (default) or you can force that to be stored on the local PC as well.
Enabling Multiple Data Sets
To enable support for multiple data sets, check the box on the MAIN tab of the ProPath Global Extension template as shown here:
This will set ProPath in the proper mode for controlling and using multiple data sets.
The location of the MAIN data folder will then be stored in an external control file as shown here:
Next use the arrows on the top of the template tabs to navigate to the "Multiple Data Sets" tab.
Template options and what they do.
If you want to allow the user to change the data sets (Add/Edit/Delete) from this application - check this box.
Note that in some cases you want to have multiple data set support in one app and control it from another. A classic example of this is a service process. In the service process app you would enable the multiple data set support, but would NOT enable the ability to change data sets from that app. You would use a separate app as the setup program where the user could create and select data sets. Then the service process app would simply use the selection.
The DataSet Procedure
To allow the user to Add/Edit/Delete data sets, import the WnChangeDataSet procedure (and the child procedure WnModifyDataSet) with the template utility menu as shown here:
This will import these pre-configured procedures into your application.
You can then change fonts, colors, text as needed (NOTE: do NOT delete any buttons as that could affect functionality and cause errors - simply hide them if needed).
You can use your own procedure to change data sets, but it is not recommended. If you do use your own procedure, specify it here. Note that it should be a NON-MDI window.
When your procedure closes, you will need to change the value of FOLDER:MAINData like this:
FOLDER:MAINData = CLIP( SomeNewFullPathToTheFolder )
Then the ProPath template code will call the ProPathResetPaths procedure to update the file paths as needed.
If you use your own procedure, you MUST check the box to Disable INI file checks and normal dataset handling since that generates code based on using the included procedures.
Program Startup Action
This setting controls when the WnChangeDataset procedure is shown as the program is starting. The default is to use a user controlled VAR that is stored by the default procedure and retrieved automatically by the templates.
User Specific Settings
By default ProPath will store the user specific settings (such as the default data set, whether or not to show the select data set window on startup, etc) in the same file in the user SYSTEM folder as was specified to hold the location of the FOLDER:MAINData. You can also specify a different INI file in that folder (note use the name of a variable - do NOT include the "!" character). If this is a managed INI file, it would be the name of the VAR you specified in ProPath to manage it here.
The Multiple Data Set Control File
This file controls the pick list of available data sets, their descriptions and statistical data.
It defaults to DataSets.INI and by default it is stored in the FOLDER:MAINData location so that all data sets would be available on a shared pick list between users.
However you can check the box to force that control file to be stored in the FOLDER:SYSTEMData location.
Note that in a multi-user environment, this will mean that you have to create dataset names and pick locations for each user.
Multiple Data Set Options
These check boxes control the buttons on the WnSelectDataSet and WnModifyDataSet procedure windows. If the boxes are unchecked, then the buttons are hidden.
Folder Variable Name
This is the name of the variable as specified for the MAIN data set. It is shown here as a reminder (you should never change these unless you absolutely have to since all the help and template files refer to them by these names).