Record scripts are a generic form of hook that are called in response to an event on a Rational ClearQuest form or from other hooks. Typically, record scripts are used to implement an action that you want to perform in response to a click event on a push button or on a context menu item associated with a particular field on a Rational ClearQuest form. Record scripts are scripts that can be executed within the context of one record type.
If you associate a record script to a push button, when a user pushes the button, the script is executed.
All record scripts have the following syntax:
Function RecordTypeName_ScriptName (param) ' input param As Variant 'The content of the script... End Function
sub RecordTypeName_ScriptName { my($result); my($param) = @_; # The content of the script ... return $result; }
Lorsqu'il est associé à un contrôle de formulaire, le paramètre transmis à la méthode contient une instance de la classe EventObject. Cette instance contient des informations concernant l'événement à la suite duquel le point d'ancrage a été appelé. (See Form Control Events for information on these events.)
When calling a record script from another hook, the parameter you pass into the method is a Variant containing whatever data is appropriate. If the record script returns data to the calling hook, that information is returned as a Variant as well.
You can associate one or more record scripts to a form control.