How to use XFCNs & XCMDs in Rev?

J. Landman Gay jacque at hyperactivesw.com
Tue Feb 27 11:38:26 EST 2007


Tim MacKenzie wrote:
> 
> How do you install and use XFCNs and XCMDs in Rev?

In most casess, you won't need to because Revolution is so feature-rich 
that most of the things HyperCard required XCMDs to do are already built 
into Revolution. So before you even try to use an XCMD, see if the 
feature is already available in native Revolution. In all the years I've 
been using Revolution, I have only had to use an external two or three 
times. Virtually everything I used to use HC XCMDs for can be done in 
regular scripting.

If you really, really do need an XCMD or XFCN, be aware that they will 
only work on OS 9 standalones. If you want to use them in OS X, you'll 
need to program a Revolution external (different than an XCMD) using the 
Revolution API.

There is currently no OS 9 engine for the latest Revolution build, so 
you will need to regress to 2.6.x to get that engine when buildling a 
standalone. Once you have that and have built the standalone, open a 
resource fork using ResEdit (or similar) and install the XCMD just as 
you did with HyperCard. After that, usage is the same as in HC. Just 
call the XCMD using the syntax you used in HC.

One other thing: only XCMDs/XFCNs that use the older 1.0 interface will 
work. XCMDs that use the 2.0 format cannot be used. This means that 
basically any XCMD written after HC 2.0 was released cannot be used.

Given all the restrictions on XCMDs/XFCNs in Revolution, it is really 
much better to see if you can rewrite the functionality using native 
syntax. Revolution is so fast that a native solution almost always runs 
faster than an XCMD because you avoid the overhead of calling out to an 
external.

If you want to let us know about some of the XCMDs/XFCNs you need, we 
can probably tell you how to do the same thing in native scripts.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list