Chapter Contents


SAS/AF Software: Class Dictionary

Using the External File List Model

You can use the External File List Model class in conjunction with a viewer control for model/view communication. When you drop a model on a control in a frame, or you set the control's model attribute to the name of the instantiated model object, the items attribute of the view is automatically set to the items attribute of the model. Each item returned by the external file list model describes a directory member (either a file or another directory) unless the external file list's fileDisplayed attributes is set to 'No'.

For example, add a list box control and an external file list model to a frame, then set listbox1.model to externalfilelist1.

You can also use the model in an SCL program to retrieve a list of external files. Simply query the items attribute to get the list of external files. To further qualify the selection, specify other attribute values for the object before you query items.

Note:   This model displays only those files that have been allocated within the current SAS session. You can allocate files through the FILENAME statement or an SCL function.  [cautionend]

Working with External File Names

The External File List Model items attribute is populated by a list of external files. Each list item is assigned a unique name that is equal to the name of the external file. The unique name appears in the viewer to which you assign the model as long as the model's filerefDisplayed attribute is set to Yes.

If filerefDisplayed is set to No, the name will not appear in the items attribute list, which means it will not display in any associated view. Each item on the list, however, is a named item that also corresponds to the external file name. You can query the items attribute list using the NAMEITEM function to determine each external file's unique name.

  1. Create a frame with a listbox, externalfilelist model, and a text label.

  2. Add the following SCL code:

  textlabel1.label=nameitem(Externalfilelist1.items, Listbox1.selectedIndex);

Chapter Contents



Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.