Futurebasic/Language/Reference/tbalias

TBALIASEdit

StatementEdit

(+) Appearance (+) Standard (+) Console

SyntaxEdit

TBALIAS oldName,NewName

DescriptionEdit

As the Mac OS matures, terse and economical toolbox names give way to more descriptive names. In C, this spells disaster because there is no way to stay in step except to go through all of your projects and change the name of the toolbox call to match Apple's latest syntax. FB offers a more elegant solution by providing an alias. A toolbox alias is a synonym that FB uses to translate all of your old syntax into the latest PPC toolbox names. This happens more often than you might imagine. Some common aliases are shown below: TBAlias InsertMenuItem , InsMenuItem TBAlias DeleteMenuItem , DelMenuItem TBAlias GetMenuHandle , GetMHandle TBAlias CountMItems , CountMenuItems TBAlias GetControlValue , GetCtlValue Without these TBALIAS statements, your existing code would break when it used a common toolbox like GETMHANDLE. With the alias in place, FB sees "GETMHANDLE" and automatically translates it to "GETMENUHANDLE". The result is that your old code continues to work in a modernized environment.

See AlsoEdit

LIBRARY; TOOLBOX