Chapter 5 Managing Global Variables (I)

The administrative portal provides tools to manage global variables, and the system classes provide methods to perform some of the same tasks. This chapter describes how to use these tools.

General advice

As with the ObjectScript commands SET, MERGE, KILL, and others, the tools described here provide direct access to operational global variables. If deleted or modified through global access, all object and SQL integrity checks are bypassed and there is no undo option. Therefore, it is important to be very careful when performing these tasks. (Viewing and exporting does not affect the database and is a secure activity.)

When using the tools described in this chapter, make sure that:

  • Which global variables IRIS uses. Not all of these are considered “system” global variables – that is, some of them are visible even if the “system” check box is not checked. Some of these global variables store code, including code.
  • Make sure you know which global variables your application uses.

Applications use global variables even if they never perform any direct global access. Remember that if you create persistent classes, their data and any indexes are stored in global variables, whose names are based on the class name (by default).

Overview of the Global Variables page

The MANAGEMENT portal includes the global page, which allows you to manage globally. On this page, you can do the following:

  • Select View in the global line to examine it.
  • Select Edit in the global line to modify it.
  • Select Export to export global variables.
  • Select Import to import global variables.
  • Select Delete to remove global variables.
  • Select Find to find the value in a global variable.

This page also includes options for viewing routines and classes; These options are not discussed here.

To access this page from the MANAGEMENT Portal home page, do the following:

  1. Choose System Explorer > Globals.
  2. Select the namespace or database you are interested in:
  • Select a namespace or database from the lookup list.
  • Select the desired namespace or database from the list displayed.

Select the namespace or database update page to display its global variables.

  1. If you’re looking for a particular global variable and don’t see its name at first:
  • Optionally specify a search mask.

To do this, enter a value in the Globals field. If the string ends with an asterisk “*”, the asterisk is treated as a wildcard, and the page displays each global variable whose name begins with the string before the asterisk. Enter a value and press Enter.

  • Optionally select the System project to include all System global variables in the search.
  • Optionally, select a value from Page size that controls the number of global variables to list on any Page.

View global variable data

The View Global Data page lists the nodes for a given global. In this table, the first column shows the row number, the next column lists the nodes, and the right column shows the values. This page initially shows the top 100 nodes in the global.

To access this page, display the Globals page and select the View link next to the global name. Or click the View button.

On this page, you can do the following:

  • Specifies the search mask. Edit the value in “Global Search Mask” as follows:
    • To display a single node, use a full global reference. Such as:^Sample.PersonD(9)
    • To display a subtree, use a partial global reference without closing parentheses. For example,^%SYS("JOURNAL"
    • To display all nodes that match a given subscript, include the desired subscript and leave the other subscript fields blank. Such as:^IRIS.Msg(,"en")
    • To display all subtrees that match a given subscript, use the same value as the previous option, but also omit the closing bracket. Such as:^IRIS.Msg(,"en"
    • To display nodes that match subscripts of a range, use subptValue1: scriptvalue2 instead of subscripts. Such as:^Sample.PersonD(50:60)
    • As with the previous option, if the closing bracket is omitted, the subtree is displayed. Then click Show or press Enter.
  • Specifies the number of different nodes to display. To do this, enter an integer in the maximum number of lines.
  • Repeat the last search. To do this, select a search mask in the search history drop – down list.
  • Select Allow editing to make the data editable;
  • To close this page, click Cancel.

Edit global variables

Note: Before making any edits, make sure you know which global variables IRIS uses and which global variables your application uses; Please refer to “General Advice”. There is no undo option. The modified global Settings cannot be restored.

Use the Edit Global Data page to edit global data. In the table, the first column shows the row numbers, the next column lists the nodes, and the right column shows the values (with a blue underscore to indicate that the values can be edited). This page initially shows the top 100 nodes in the global.

To access and use this page do the following:

  1. The Global Variables page is displayed.
  2. Select the edit link next to the global name.
  3. You can choose to use a global search mask field to refine the display. See “Viewing Global Data”.
  4. (Optional) Specify the number of different nodes to display. To do this, enter an integer in the maximum number of lines.
  5. If necessary, navigate to the value you want to edit by selecting the corresponding subscript.
  6. Select the value to edit.
  • The page then displays two editable fields:
  • The top field contains the full global reference to the node being edited. Such as:^Sample.PersonD("18").
  • You can edit it to reference different global nodes. If you do, your actions will affect the newly specified global node.
  • The bottom field contains the current value for this node. Such as:
$lb("",43144,$lb("White","Orange"),$lb("8262 Elm Avenue","Islip","RI",57581),"Rogers,Emilio L.",
$lb("7430 Washington Street","Albany","GA",66833),"650-37-4263","")
Copy the code

Edit the values as needed. 7. If you want to edit it, click Save to save the changes, or click Cancel.

Or, to delete the node, do the following:

  1. You can also choose to delete global child nodes during the deletion process
  2. Click Delete.
  3. Click OK to confirm this operation.