8. Using Vision Advanced Features : Using Local Procedures : Enter Local Procedure Code
 
Share this page                  
Enter Local Procedure Code
To enter or change the code for a local procedure
1. Display the Edit Local Procedures window as described in the Creating a Local Procedure section.
2. Position the cursor on the name of the procedure you want to edit.
3. Select Edit from menu.
4. Select EditSource from the menu.
Vision displays the local procedure source code popup. Before you enter any code for a procedure, the popup shows the code for an empty procedure. See the following figure:
5. Edit the source code in one of the following ways:
Directly in the local procedures pop-up window
With the default system editor
From an external file
Each of these methods is described in its own section below.
6. From the local procedures popup, select Save.
7. Select End to return to the Edit Local Procedures window.
8. Repeat Steps 2 through 7 to edit additional local procedures, or select End to return to the window in which you were working.
How You Can Enter Local Procedure Code Directly in the Window
When Vision displays the pop-up window for writing local procedure code, you can enter your code directly in the window. The standard Ingres window editing keys and functions are available.
The following additional edit operations are available on the local procedure pop-up window:
Edit
Calls the system editor and opens a file for you to write your local procedure code, as described in Enter Code Using the System Editor
Blank
Clears the window. Be aware that there is no "undelete" function to restore text after you have cleared the window.
LineEdit
Displays a submenu with these line editing functions:
InsertLine
Inserts a blank line above the line on which the cursor is positioned
DeleteLine
Deletes the line on which the cursor is positioned
SplitLine
Divides a line into two lines at the point where the cursor is positioned
JoinLines
Moves the next line to the end of the line on which the cursor is positioned
Variables
Lets you create or edit local variables or global components to use in your local procedure code
Save
Saves the local procedure code you have entered
Enter Code Using the System Editor
You can use your system editor to write your local procedure code, rather than using the line edit functions. Vision uses the default system editor.
See your Ingres system administrator if you want to change this default. If you are using a PC, see the system administrator of the remote node.
To write local procedure code using your system editor
1. When Vision displays the pop-up window for entering local procedure code, select Edit from the menu.
Vision calls the system editor and opens a file.
2. Enter your code in the window, using the standard editor operations.
3. When you are finished entering your code, save your file and exit from the editor.
Vision places the text from the file into the local procedure code pop-up window.
To edit the file containing this code, select Edit again. Vision redisplays the file.
Enter Code Using External Files
When editing local procedure code, you can use external text files to:
Write text from the window to a file.
Read text from a file to the window.
Using an external text file is especially convenient if you are using the same or similar local procedure code in more than one place. You can write the code to a file when you first create it, then read in this file for additional instances of local procedure code.
When you write local procedure code to an external file, you simply are using it to store your code. Vision does not access the file itself when it runs a frame containing the local procedure code.
You can store a basic version of the code in the file, then call the file and change the code as needed each time you use it.
To write local procedure code to a file
1. Enter the code in the local procedure code pop-up window.
2. Select File from the menu.
3. Select WriteFile from the submenu.
Vision prompts you for a file name.
4. Enter the name of the file in which you want to save your local procedure code.
If the file is not in the current directory, be sure to enter the entire directory path.
5. Press Return.
Vision saves your text in the file and returns you to the local procedure code pop-up window.
To read local procedure code from a file
1. Display the pop-up window for entering local procedure code.
2. Select File from the menu.
3. Select ReadFile from the submenu.
Vision prompts you for the name of the file.
If the file is not in the current directory, be sure to enter the entire directory path.
4. Enter the name of the file containing the local procedure code and press Return.
Vision writes the file to the window. If any text is in the window, Vision places the contents of the file above the line on which the cursor is positioned.
If you make any changes to the file text while it is displayed in the window, you can either write the new text back to the file or create a new file.