5.1.4:Function Handlers

ファンクション(関数)ハンドラ

Each function handler begins with the
function control structure followed by the name of the function that this handler computes. The handler ends with the end control structure and the name of the function. Function handlers are typically called by another handler and return a value using the return control structure. Function handlers look like this:

ファンクション・ハンドラは必ず「function」コントロール構造で始まり、その後ろにこのハンドラが計算する関数の名前が続きます。ファンクション・ハンドラは必ず「end」コントロール構造で終わり、その後ろには関数名が続きます。ファンクション・ハンドラは、一般的に他のハンドラから呼び出される形式のハンドラで、「return」コントロール構造を使って値を返します。ファンクション・ハンドラは次の様なものになります。



     function currentDay
       return item 1 of the long date
     end currentDay



A function handler is executed when a handler in the same script (or one in an object lower in the
message hierarchy) calls the function. This example handler returns today's name.

ファンクション・ハンドラは同一スクリプト内(或いは、メッセージ階層の下位のオブジェクト)にあるハンドラがファンクションを呼びだした時に実行されます。この例では、ファンクション・ハンドラは今日の日付データのうちの曜日を返します。