Usage

Syntax: public function f(...) { statements; }

Explanation

The public keyword binds a function to the this object and gives it global scope. That is, the function becomes a method of the object to which this refers and can be called from anything on the same side (i.e., server- or clientside) as the function definition, as opposed to being accessible only to the script where it is defined. This is common practice in binding a function to a TStaticVar via join.

Example

const e = 2.71828183;

public function exprandom() {
  return log(e,random(0,2^32-1));
}


Categories

CategoryLanguageConstruct

There are no comments on this page. [Add comment]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki