Home About Rice Downloads Documents Others Cooker CookerGX
Documents  >  Reference  >  fitter
fitter definition

fitter definition

A fitter is subroutine to initialize an instance of class. It is used with a new operator, and returns an initialized copy of the prototype of class.

Fitter definition is the following format.


access-control fitter fitter-name(arguments)

statements

endfitter


In the class definition, it is possible to define fitters of any number at any place outside the other member definitions.

access control

Access-control determines the access level of the fitter by specifying a keyword either open or closed.

If the access-control is open, you can invoke the fitter from outside the class definition. If the access-control is closed, you can invoke the fitter only inside the class definition.

fitter keyword

fitter keyword indicates that this definition is fitter. It must be present between the access-control and fitter-name.

fitter name

The fitter-name has to be the same as a class name that has the fitter as a member.

arguments

The arguments are pairs of the class name and identifier which is surrounded by parentheses. the pair can be specified any number. When there are two or more the pair, it have to separate by comma.

For example,


open fitter sampleClass()

open fitter sampleClass(int index)

open fitter sampleClass(int index, string message)


There is not a special keyword which indicates that there is no arguments. If the argument is not, you do not have to specify anything in the parentheses

statemants

The statements is optional. Namely, the fitter without a statement is permitted. In that case, a copy of the prototype is returned.

endfitter keyword

An endfitter is a keyword which indicates an end of a fitter definition. It has to exist at the end of a definition.

overload

The fitter name has to be the same as a class name, but you can define fitters of any number if number and type of arguments are different.

scope

A fitter generates a scope.

Please refer to the manual about the scope.

return

A fitter can return to invoker from anywhere by return statement. The return statement of the fitter should not return an instance. If the control has reached the endfitter without encountering a return statement, it assume that there was a return statement and return to caller.

Next
Previous
Copyright © Rice All rights reserved.