Chapter Contents

Previous

Next
GET_DATA Data Vector: _init

GET_DATA Data Vector: _init



Initializes the data vector


Syntax
Details
Example

Syntax

CALL SEND (data-vector-id, '_init'<, data-vector-info>);

Argument Type Description
data-vector-info
N specifies the identifier of an SCL list to contain initialization information that the data vector can use when initializing


Details

The _init method allocates the GET_DATA data vector resources. It also calls the super _init method.

The _init method is called whenever you make an instance of the GET_DATA Data Vector class, either through a call to _new or to the instance function.

The data-vector-info list is optional. The list tells the data vector which type of viewer this data vector will be used with if that information is known. This list can also contain NOFORME or NOTABLEE, which are numeric named items.

If you do not use this list, resources for both the form-specific and table-specific parts of the data vector are allocated, and you are allowed to use data vector methods that deal with information that either viewer will use.

When you create the GET_DATA data vector, if you know that it will only be used in conjunction with the table editor, you can save resources and receive additional error checking by setting a named item of NOFORME to 1 in this list. In that case, only the table-specific resources will be allocated, and when you attempt to call methods of the GET_DATA Data Vector class that deal with form-specific information, you will receive a program halt.

On the other hand, when you create the GET_DATA data vector, if you know it will only be used in conjunction with the form editor, you can receive additional error checking by setting a named item of NOTABLEE to 1 in this list. In that case, there will not be any resource savings, but when you attempt to call methods of the Row/Column Data Vector class that deal with table-specific information, you will receive a program halt.

The table editor sets the NOFORME item to 1 in the data-vector-info list for the data vectors it uses internally for the resource savings. The form editor does not pass a data-vector-info list for the data vectors it uses internally.


Example

The following example is a code fragment that creates an instance of the GET_DATA Data Vector class for use only with an instance of the Form Editor class. If this code fragment were used as part of an application, any objects that were instantiated during execution would need to be terminated when those objects were no longer needed. Likewise, any lists that were created during execution would need to be deleted when those lists were no longer needed.

 Note about code
arglist = makelist();
rc = setnitemn(arglist, 1,
              'NOTABLEE');
classid = loadclass('sashelp.fsp.
                     gddvec');
call send(classid, '_new', gddvecid,
          arglist);
call send(gddvecid, '_setNumberOfColumns',
          1);
call send(gddvecid, '_setIndex', 1);
 Note about code
call send(gddvecid, '_setBorderColor',
         'TOP', 'green');

The above code causes a program halt because it attempts to call the _setBorderColor method, which is only for the table, even though you specified that this instance will only be used with a form. The following error message is generated:

ERROR: Table-specific method called on
       form-specific data vector.
Arguments passed to SEND:
  1 GET_DATA Data Vector ID = 33
  2 (Character Literal) = '_setBorderColor'
Parameters passed to SEND ENTRY:
  1 (Character Literal) = 'green'


Chapter Contents

Previous

Next

Top of Page

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