Documentation

Added in v2.32

packages

Syntax: %packages(windowname[,newlist])

Set or return the list of packages enabled for a window/module. If the name of the window/module is omitted, the current window is used. If the packagelist is omitted, the current list of packages is returned unchanged. Otherwise the packagelist contains a string list of packages to enable.

Examples:

#SHOW %packages(%curwin)
#SHOW %packages()

These will both print the list of packages enabled for the current window

$templist = %packages(%curwin)
#ADDITEM $templist NewPackage
#CALL %packages(%curwin,$templist)

adds the package 'NewPackage' to the list of enabled packages for the current window. Note that the NewPackage must be loaded for this to work.

Advanced Examples: :

Assume that a package called "Chat" is used to clean up the chat windows in $WindowList, but that is the only package should be applied to those chat windows. This will set the only enabled packages for those windows to be "Chat"

$WindowList = "OOC|QA|IC|RL|Says|Direct"
$pkgName="Chat"
#FORALL $WindowList {
#CALL %packages(%i,$pkgName)
}

This can be taken a step further by adding it as an onLoad EVENT in the "Chat" package as follows:

#EVENT onLoad {

$WindowList = "OOC|QA|IC|RL|Says|Direct"
$pkgName="Chat"
#FORALL $WindowList {
#CALL %packages(%i,$pkgName)
}

}

Add comment

Login or register to post comments