[futurebasic] Re: Bus error

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : September 1998 : Group Archive : Group : All Groups

From: MAWRPh@...
Date: Fri, 11 Sep 1998 03:01:31 EDT
In a message dated 9/10/98 1:24:18 PM, benjamen@... wrote:

>>
>>osErr% = FN AEDISPOSEDESC (AEDesc&)
>>
>>If I comment this out everthing works OK (seems to anyway). 
>
>This was a big problem when I first started using AEs, things to try:
>
>1) Either the toolbox definitions you have is expecting a reference, or you
are
>passing a reference to a toolbox definition that dosn't want one. (This
dosn't
>affect AEDISPOSEDESC,though as it is built-in to FB)
>
>2) Descriptors are 8 bytes long (plus any storage they refer to).  Make sure
that
>your not just DIMing a var like AEDesc& and using that (as that is only 4
bytes).
> You have to either DIM two longs in a row or use the proper DIM RECORD
stucture:
>
>DIM RECORD AEDesc
>  DIM descType&
>  DIM descHandle&
>DIM END RECORD.AEDesc
>
>DIM myAEresultDesc.AEDesc
>osErr% = FN AEDISPOSEDESC(#@myAEresultDesc)
>
>3) You can't just check AEDesc& (sorry Bill), as the handle that
AEDISPOSEDESC
>uses is 4 bytes after that.  Thats why you need the RECORD setup if you want
to
>do any peeking around:
>
>PRINT "Any Memory here: "; myAEresultDesc.descHandle&
>
>Jamin

Thanks Jamin. I was using DIM AEDesc&;0 which came straight from the "hidden"
Andy Project AEopen.INCL file. I changed this to AEDesc&;8 and it fixed the
problem. Now my next question is, is this change sufficient or is it better to
DIM the record and modify the offending line as you describe?

Thanks to all who responded.
Mark