Externals Under 2.7.x

Trevor DeVore lists at mangomultimedia.com
Fri Feb 9 11:05:01 EST 2007

On Feb 9, 2007, at 4:24 AM, Dave wrote:

> I am trying to make an External work under I downloaded  
> and used the "External Creator V1.rev" from the  
> "ExternalsEnvironmentV2" article. At the moment I just have one  
> simple function that just passes back a value to the calling stack.  
> However I get an execution error when I run the Script. I've check  
> that "the externals" is set correctly and the XCode project builds  
> ok and I get an X86-32 bundle file ok.

Hi Dave,

One thing to keep in mind with externals is that the externals  
property of a stack only tells Revolution where to find the external,  
it doesn't signify that the external has properly loaded.  To know if  
an external has loaded check the externalPackages property of the  
stack.  If the external has successfully loaded then the string you  
defined in EXTERNAL_BEGIN_DECLARATIONS will appear as one of the  
lines in the property.

> I am using a Mac Pro and Runner Mac OS X Tiger 10.4.8. I only need  
> to produce an external for Intel based Macs at the moment.
> Does anyone know if there's some kind of magic I have to perform to  
> make this work?

Are you trying to test using debugging in XCode?  If so, make you  
sure you build a release version first, then the debug version.  For  
some reason if you don't build the release version first, the  
environmental variables aren't set correctly when the XCode debugger  
launches Revolution and your sample external stack will not load.

> If anyone has a sample Intel/Mac External they have build that I  
> could test to see if it works that would be great. Or if someone  
> could send me a sample XCode project that would be good too!
> A couple of specific questions:
> 1.  Does the name in the EXTERNAL_BEGIN_DECLARATIONS need to be all  
> lowercase?


> 2.  Does the name in the EXTERNAL_DECLARE_FUNCTION need to be all  
> lowercase?


> I have appended the C Code from the XCode project at the end of  
> this message.

One other thing to keep in mind: In your code you are setting  
*theErrorFlagPtr to True if an error occurs.  This will produce an  
error dialog in Revolution but I'm not sure if you can see the error  
string that you put in *theResultPtrPtr anywhere which is  
unfortunate.  So another possibility is that your function is  
returning an error and that is the dialog that Rev is displaying.   
Until I find out how to display the actual error string if  
theErrorFlagPtr == True I've resorted to always setting it to false  
and handling the errors in Revolution itself.

Hope this helps,

Trevor DeVore
Blue Mango Learning Systems - www.bluemangolearning.com
trevor at bluemangolearning.com

More information about the Use-livecode mailing list