listbox1._deselectAll();
Method1: method name:char number:num; endmethod; Method2: method number:num name:char; endmethod; Method3: method name:char; endmethod; Method4: method return=num; endmethod;Each method signature is a unique combination, varying by argument number and type:
Method1 sigstring: (CN)V Method2 sigstring: (NC)V Method3 sigstring: (C)V Method4 sigstring: ()NThe parentheses group the arguments and indicate the type of each argument. The value outside the parentheses represents the return argument. The V character (for “void”) indicates that no return value is used. A notation that has a value other than V indicates that the signature has a return value of that particular type. For example, Method4, above, returns a numeric value.
/* Method1 */
/* Responds to calls using the (CN)V signature */
object.setColNum('colname', num);
/* Method2 */
/* Responds to calls using the (NC)V signature */
object.setColNum(num, 'colname');()N. The following are valid
operations:dcl num returnVal; returnVal=object.getData();or
if object.getData() > 1 then do ...or
if ( object.getData() ) then do ...
()V,
meaning that no arguments are passed into the method and no values
are returned.
|
Method Calling Statement
|
Method Signature
|
|---|---|
|
object.setColor(color);
|
(C)
|
|
object.setColor(r, g, b);
|
(NNN)
|
mymethod (NN)V mymethod (CC)Nbut not
mymethod (NC)V mymethod (NC)N
/* method1 */ getColNum: method colname:char number:update:num; number = getnitemn(listid, colname, 1, 1, 0); endmethod; /* method2 */ getColNum: method number:update:num colname:char; number = getnitemn(listid, colname, 1, 1, 0); endmethod;
init:
DCL num rc metadata;
DCL object obj;
obj=loadclass('sashelp.mycat.maxClass.class');
/* metadata is a numeric list identifier */
rc=obj._getMethod('getMaxNum',metadata);
call putlist(metadata,'',2);
return;(NAME='getMaxNum'
SIGNATURE=(
NUM1=( TYPE='Numeric'
INOUT='Input'
DESCRIPTION='First number to compare'
)
NUM2=( TYPE='Numeric'
INOUT='Input'
DESCRIPTION='Second number to compare'
)
RETURN=( TYPE='Numeric'
DESCRIPTION='Returns the greater of two numeric values.'
INOUT='Return'
)
)
SIGSTRING='(NN)N'
ENTRY='sasuser.mycat.maxClass.scl'
LABEL='getMaxNum'
CLASS=4317
METHODID=4331
STATE='N'
DESCRIPTION='Returns the greater of two numeric values.'
ENABLED='Yes'
SCOPE='Public'
)sasuser.app.methods.sclnewMethod: public method
item:input:num
return=num;
/* ...more statements... */
endmethod;| Type | is the argument type. Valid values are |
| INOUT | determines how the argument will be used in the method. Valid values are I | O | U | R (corresponding to Input, Output, Update, Return). |
| Description | is a text description of the argument. |
| Return_MethodID | is the unique identifier of the method; it is assigned when the method is created and is returned in this named item. |