Previous Topic: Control Options

Next Topic: Record a Script

Control Data

Control data is used to delineate separate scripts and define the attributes for each specific script within a member in YSCRIPT (either the DEFAULT member or a user's member). Control data begins with '%%' (double-percent-sign) followed by a data-identifier, as follows:

%%NAME:script-name

Indicates the name of the script. Each script name must be unique within a member. Each script name must be a valid system name and must not contain any underscores.

%%TEXT:script-description

Indicates the textual description of the script.

%%SCREEN:screen-identifier/*GRPn/*ALL

Indicates the screen for which the script is valid. Screens are identified by their screen identifiers. You can use the special value *ALL to indicate the script is screen-independent. You can use the special value *GRPn to indicate the script is valid for multiple screens. If you are using *GRPn, you must include the related GROUP definition at the top of the member.

%%SCPRCV:script-recovery-option

Indicates a script-specific script recovery option is used to override the global script recovery option held in the YSCPRCV Web Option control value.

%%SCPERR:script-error-page

Indicates a script-specific error page is used to override the global script error page held in the YSCPERR Web Option control value.

In addition to these script-specific control data, you can specify global control data-identifiers at the top of the member, as follows:

%%USER:user-name

Indicates the name of the user for whom the member was created.

%%AUTH:*ALL/*USE

Indicates whether the user has authority to create, delete or edit scripts. If set to *USE, the drop-down list of available scripts does not include any control options. If set to *ALL, the drop-down list of available scripts includes control options in addition to the available scripts. For more information about available control options, see Control Options.

%%GROUP:group-identifier list-of-screen-identifiers

Indicates a group of screens for which certain scripts are available. By grouping screens, individual scripts can easily refer to the group-identifier in their %%SCRIPT: control datum. Multiple %%GROUP: control-data-identifiers can be present. If an individual script refers to a group, the script is available on any screen within that group.

In the following example, you can see the heading data defining two screen-groups; Group1 contains 6 screens and Group2 contains 3 screens. There are two separate scripts, the second script uses *GRP1 as its screen group (indicating that it is available on any of the 6 screens that make up Group 1):

%%==============================================================
%%USER:Mickey Mouse
%%AUTH:*ALL                              
%%SCPRCV:*RECOVER                        
%%SCPERR:YSCPERR                         
%%GROUP:1 C2E0005132,C2E0005133,C2E0005134
%%GROUP:1 C2E0005135,C2E0005136,C2E0005137
%%GROUP:2 C2E0001000,C2E0001024,C2E0001995
%%==============================================================
%%NAME:UUAGEFR                                                        
%%TEXT:Go to UUAGEFR                                                  
%%SCREEN:C2E0005134                                                   
:LOOP
SEND 03
IF *SID C2E000006
  IF R01C02 MAIN
    SET-FIELD _F1607U 1
    SEND ENTER
    SET-FIELD _F0181NZ 1
    SEND ENTER
    QUIT
  END-IF
  SEND 03
  GOTO LOOP
END-IF
%%==============================================================
%%NAME:DLTTOPRCD                 
%%TEXT:Delete first subfile record
%%SCREEN:*GRP1              
SET-FIELD _F0722U 4              
SEND ENTER                       
SET-FIELD _F1913U Y              
SEND ENTER

For more information about the control options that can be displayed when a list of scripts is built, see Control Options.

Note: If you are changing an existing user's authority (using %%USER and %%AUTH) specified in the user's member in YSCRIPT, you must end and restart the web option server for the changes to take effect.