[ Home | CW Bug Reports | Mail ]

LModelDirector::HandleDoObjectsExistEvent()誤った結果
Subject: BUG -- PP1.9.3 LModelDirector::HandleDoObjectsExistEvent() wrong result
 
---------------------------------------------------------------------------
METROWERKS PRODUCT AND USAGE SECTION
 
Product name :            [ CodeWarrior Professional ]
Product version :         [ Pro 4 ]
Component name :          [ PowerPlant 1.9.3]
Generating:               [ Mac OS 68K / Mac OS PowerPC ]
Purpose:                  [ application ]
 
---------------------------------------------------------------------------
 
BUG DESCRIPTION SECTION
 
Reason for this report:   [ incorrect program feature ]
Bug severity:             [ executes incorrectly ]
Reproducibility:          [ always ]
Problem summary:
 
You must count items if the directObjToken is a list. It can be an
empty list. The following AppleScript always returns true without
this.
 
tell application "YourApp"
    exists (windows whose name is "!@#$%")
end
 

    StAEDescriptor      directObjToken; // moved
 
    {                                   // Failure to resolve is OK, so
                                        //   we temorarily disable throw
        StDisableDebugThrow_();         //   debugging
 
                                        // Try to resolve direct object
///     StAEDescriptor      directObjToken;
        err = Resolve(directObj, directObjToken);
    }
 
    if (err == noErr) {                 // Object exists if Resolve succeeded
        //-----------------------------------------------------------
        //  You must count items if the result is a list.
        //  It can be an empty list.
        //-----------------------------------------------------------
        if (directObjToken.DescriptorType() == typeAEList) {
            SInt32  nItems = 0;
            ::AECountItems(directObjToken,&nItems);
            exists = (0 < nItems);
        }else{
            exists = true;
        }
        //-----------------------------------------------------------
///     exists = true;
 
    } else if (err != errAENoSuchObject) {
        Throw_(err);                    // If Resolve failed for a reason
                                        //   other than "no such object",
    }                                   //   then we need to throw


この Pageは MacOS X + Radio UserLand で作っています。