Using Dive Scripts
After building a cBase, you can use a Dive to access the data. You define a Spectre Dive by writing a script. Before starting, you may want to review the basic structure found in Dive Code Block and the list of possible attributes found in Dive Tags.
-
In your Workbench project, select File > New > Spectre Dive File.
The New Spectre Dive File dialog displays.
- Select a parent folder where the file will be saved. The recommended folder is /programs.
-
Specify a Name and click Finish.
The new Dive opens in the text editor.
-
Position your cursor inside the red quotes, highlight my-cplan, and enter the name of your cPlan. For example:
cplan "/cplans/dairy.cplan"
- Add a carriage return at the end of the line to add a new line to the script.
-
Hit Ctrl-space to see a popup of possible tags to use next.
- In the pop-up, locate the desired tag.
- Select it and hit enter.
-
The text editor continues to offer suggestions.
- Continue in this fashion to complete your Dive.
-
On the toolbar, click the green arrow to run the Dive script.
The results appear in the Output tab below the main window space.
-
In your Workbench project, select File > New > Spectre Dive File.
The New Spectre Dive File dialog displays.
- Select a parent folder where the file will be saved. The recommended folder is /programs.
-
Specify a Name and click Finish.
The new Dive opens in the text editor.
-
Position your cursor inside the red quotes, highlight my-cplan, and enter the name of your cPlan. For example:
cplan "/cplans/dairy.cplan"
- Add a carriage return at the end of the line to add a new line to the script.
-
Hit Ctrl-space to see a popup of possible tags to use next.
- In the pop-up, locate the desired tag.
- Select it and hit enter.
-
The text editor continues to offer suggestions.
- Continue in this fashion to complete your Dive.
-
On the toolbar, click the green arrow to run the Dive script.
A results file is created in the /temp/dive_results folder. If those folders do not exist, they are created when you run the Dive script. The results file opens.
See also: