Displaying all fields in a record: Difference between revisions
No edit summary |
No edit summary |
||
Line 12: | Line 12: | ||
: 2. While debugging a request, you press CTRL-A when you are in a record context. | : 2. While debugging a request, you press CTRL-A when you are in a record context. | ||
:: In a <var>Value</var> window, you see a PAI format display of the current record. | :: In a <var>Value</var> window, you see a PAI format display of the current record. | ||
: [[File:pai2_zoom60.gif|427x206px|pai2]] | |||
:: A Value window display is the default. As shown below, the output may also be displayed in the macro console window. | :: A Value window display is the default. As shown below, the output may also be displayed in the macro console window. | ||
Line 21: | Line 21: | ||
<span class="f_Para">You [[Creating and running a macro|run the macro]] at a debugging execution point where there is a current record, and although it is not required, you have the [[Using the console and command line|macro console]] open. The record's PAI output displays on the console. </span> | <span class="f_Para">You [[Creating and running a macro|run the macro]] at a debugging execution point where there is a current record, and although it is not required, you have the [[Using the console and command line|macro console]] open. The record's PAI output displays on the console. </span> | ||
: [[File:paimac1_zoom70.gif|459x358px|paiMac1]] | |||
=== Displaying a record's field groups === | === Displaying a record's field groups === | ||
<span class="f_Para">If you are debugging a request against a file with field groups, the </span><span class="f_Monospace">pai</span><span class="f_Para"> command display also includes the field group occurrences, each beginning with a backward slash (</span><span class="f_Monospace">\</span><span class="f_Para">) and ending with a forward slash (</span><span class="f_Monospace">/</span><span class="f_Para">). </span> | <span class="f_Para">If you are debugging a request against a file with field groups, the </span><span class="f_Monospace">pai</span><span class="f_Para"> command display also includes the field group occurrences, each beginning with a backward slash (</span><span class="f_Monospace">\</span><span class="f_Para">) and ending with a forward slash (</span><span class="f_Monospace">/</span><span class="f_Para">). </span> | ||
: [[File:paifldgrp3_zoom60.gif|427x385px|paiFldgrp3]] | |||
<span class="f_Para">To display the fields in the current field group, use the </span><span class="f_Monospace">[[pafgi command|pafgi]]</span><span class="f_Para"> command (or </span><var>Display</var><span class="f_Para"> > </span><var>PAFGI</var><span class="f_Para"> from the menu), which produces the same output as the SOUL PAFGI (Print All Fieldgroup Information) statement. The discussion above about ways to map and use the </span><span class="f_Monospace">pai</span><span class="f_Para"> command applies entirely to the </span><span class="f_Monospace">pafgi</span><span class="f_Para"> command as well. </span> | <span class="f_Para">To display the fields in the current field group, use the </span><span class="f_Monospace">[[pafgi command|pafgi]]</span><span class="f_Para"> command (or </span><var>Display</var><span class="f_Para"> > </span><var>PAFGI</var><span class="f_Para"> from the menu), which produces the same output as the SOUL PAFGI (Print All Fieldgroup Information) statement. The discussion above about ways to map and use the </span><span class="f_Monospace">pai</span><span class="f_Para"> command applies entirely to the </span><span class="f_Monospace">pafgi</span><span class="f_Para"> command as well. </span> | ||
<span class="f_Para">Invoking the </span><span class="f_Monospace">pafgi</span><span class="f_Para"> command while in field group context produces a display of the fields in the current field group. For example, for the STOOGES field group in the same request and record as in the preceding example, this is the </span><span class="f_Monospace">pafgi</span><span class="f_Para"> display. </span> | <span class="f_Para">Invoking the </span><span class="f_Monospace">pafgi</span><span class="f_Para"> command while in field group context produces a display of the fields in the current field group. For example, for the STOOGES field group in the same request and record as in the preceding example, this is the </span><span class="f_Monospace">pafgi</span><span class="f_Para"> display. </span> | ||
: [[File:pafgifldgrp_zoom60.gif|427x385px|pafgiFldgrp]] | |||
=== Field group $functions === | === Field group $functions === | ||
Line 40: | Line 40: | ||
<span class="f_Para">To view the value of either $function, you can </span><span class="f_ListBul1">right click its program line in the </span><span class="term">Source Code</span><span class="f_ListBul1"> page and select </span><var>Add Watch</var><span class="f_ListBul1"> from the context menu. </span> | <span class="f_Para">To view the value of either $function, you can </span><span class="f_ListBul1">right click its program line in the </span><span class="term">Source Code</span><span class="f_ListBul1"> page and select </span><var>Add Watch</var><span class="f_ListBul1"> from the context menu. </span> | ||
: [[File:fieldgroupcontext.png|377x179px|fieldgroupContext]] | |||
<span class="f_ListBul1">The </span><span class="f_Para">$function</span><span class="f_ListBul1"> is added to the </span><span class="f_GUIlabel">Watch Window</span><span class="f_Para"> and its current value is displayed whenever the current program context is a field group. The function value subsequently displays when the program execution point is in any field group.</span><span class="f_ListBul1"> </span> | <span class="f_ListBul1">The </span><span class="f_Para">$function</span><span class="f_ListBul1"> is added to the </span><span class="f_GUIlabel">Watch Window</span><span class="f_Para"> and its current value is displayed whenever the current program context is a field group. The function value subsequently displays when the program execution point is in any field group.</span><span class="f_ListBul1"> </span> |
Latest revision as of 15:55, 20 April 2023
The SOUL PAI (Print All Information) statement displays the values of the visible fields in a record. You can get this same display within the Debugger by using the pai command (or from the menu: Data Display > PAI).
The pai command is a Client command you specify in a macro or map to a button or hot key. If you use pai at an execution point where there is a current record (for example, in a FOR EACH RECORD loop), a display of the record's fields that is the same as the SOUL PAI statement is shown.
A typical scenario for using the pai command might include these steps:
- 1. You map the command to a key. In the ui.xml file, you specify the following to set CTRL-A to issue a pai command:
<mapping command="pai" key="a" keyModifier="ctrl"/>
- 2. While debugging a request, you press CTRL-A when you are in a record context.
- In a Value window, you see a PAI format display of the current record.
- A Value window display is the default. As shown below, the output may also be displayed in the macro console window.
Alternatively, you can use the pai command in a Debugger macro or from the command line. For example, say your macro is a pai.macro text file that has the single statement:
pai
You run the macro at a debugging execution point where there is a current record, and although it is not required, you have the macro console open. The record's PAI output displays on the console.
Displaying a record's field groups
If you are debugging a request against a file with field groups, the pai command display also includes the field group occurrences, each beginning with a backward slash (\) and ending with a forward slash (/).
To display the fields in the current field group, use the pafgi command (or Display > PAFGI from the menu), which produces the same output as the SOUL PAFGI (Print All Fieldgroup Information) statement. The discussion above about ways to map and use the pai command applies entirely to the pafgi command as well.
Invoking the pafgi command while in field group context produces a display of the fields in the current field group. For example, for the STOOGES field group in the same request and record as in the preceding example, this is the pafgi display.
Field group $functions
The Debugger recognizes and evaluates User Language $FieldGroupID and $FieldGroupOccurrence function calls. These functions are useful for operating selectively on field group instances.
$FieldGroupID returns the unique numeric identifier that Model 204 assigns to each field group in a record. $FieldGroupOccurrence returns the current occurrence number of an occurrence of a repeating field group.
To view the value of either $function, you can right click its program line in the Source Code page and select Add Watch from the context menu.
The $function is added to the Watch Window and its current value is displayed whenever the current program context is a field group. The function value subsequently displays when the program execution point is in any field group.
To view the $function value without adding it to the Watch Window, you can right click a program line that explicitly contains it and select the Display option. The value is shown in a separate Value window.