Adding SAS Component Language Programs to Frames |
There are several important items to remember when you are working with SCL programs for FRAME entries:
The SCL for a frame (often referred to as frame SCL) is stored in a separate catalog entry of type SCL. If you do not store the SCL entry in the same catalog as the FRAME entry, then the frame's SCLEntry attribute must specify the four-level name of the associated SCL entry. See Saving and Storing Frame SCL Programs for details.
The name of the SCL entry that controls a FRAME entry is assigned through the frame's SCLEntry attribute. By default, the SCLEntry attribute identifies the frame's SCL source as *.SCL, where the asterisk (*) represents the name of the FRAME entry. For example, if your FRAME entry is named MENU.FRAME, specifying *.SCL as the name of the SCL entry identifies MENU.SCL. Thus, the *.SCL designates an SCL entry that has the same name as the FRAME entry and is in the same catalog.
To check the value of the SCLEntry attribute, open the Properties window in the frame, select the object named _FRAME_ in the Properties tree, then scroll down to the SCLEntry attribute.
You can add or edit the SCL program for a frame in the SAS Source window. When a frame is displayed in the Build window, select View Frame SCL or select Frame SCL from the Build window's pop-up menu to open the frame's SCL program in the Source window.
SCL entries must be compiled with their associated FRAME entries before you can test or run them.
SCL source code is reusable, even if it is specified for a FRAME entry. Since SCL source is stored separately from FRAME entries, you can use the same SCL source for several FRAME entries without having to duplicate the SCL source for each one. For example, you can develop the prototype FRAME entries MYREPORT1.FRAME, MYREPORT2.FRAME, and MYREPORT3.FRAME. Then, create the SCL source entry MYREPORT.SCL, and identify it as the SCL source entry for each of the three FRAME entries by setting each frame's SCLEntry attribute to MYREPORT.SCL in the Properties window.
When Frame SCL Is Not Required |
A frame does not require an SCL program. Many components that you can add to a frame are designed to perform tasks without additional SCL code. For example, you can add a push button control to a frame and set its commandOnClick attribute to end. The END command then executes when a user clicks the push button. You do not need SCL to control this control's behavior.
Frame SCL entries do not have to control every component on a frame. When you create your own components (or subclass those provided by SAS software), you can add methods to perform operations. You implement these methods in an SCL entry that is separate from the SCL entries that are used by your frames. See Implementing Methods with SCL for more information.
In addition, communication between components in your application is possible without frame SCL. See Communicating with Components for more information.
When Frame SCL Is Required |
You must include an SCL program for a frame in these situations:
You need to modify a component's properties at run time. For example, values that are passed to the frame may be applied to change the attribute of a component, or you may change the appearance of a control after a user enters input.
You need to perform conditional or custom processing for the selections that a user makes or for values that a user enters.
Copyright © 2007 by SAS Institute Inc., Cary, NC, USA. All rights reserved.