Tip: Where is that property or method used?

If you need to find out where a property or method is being used, you could try doing a find, but a quicker way is to change its name, then run Analyze Project. The compiler will throw errors for the property/method it can no longer find and show you exactly where. If you don’t get errors, the thing is unused and you can either delete it or rethink your code.

I’ve done the same thing just using compile. The only drawback to this approach is if the property or method is used in #if Target statements other than the target you’re compiling you can delete something by accident and not find it until you do remote debug or final builds. Does the Analyze Project work better in that regard?

No, but building for all platforms would, as you alluded.

I sort of wish Analyze would do this against all targets as it would be more complete (but much slower).

Or an option to do that, maybe a submenu that included other platforms. In other words, if you’re on a Mac and it’s a non-mobile app, the submenu would include

Analyze For ->
  Windows
  Linux

I’ll file a FR for that as it would helpful in other circumstances too.

Looks like there are several already:
<https://xojo.com/issue/5095>
<https://xojo.com/issue/3410>

Right you are. Thanks, you saved me some time.

Another Tip is to change the property to a computed property, which allows you to set Getters and Setters and put breakpoints to see exactly when the property is being changed. This is useful since the Xojo debugger doesn’t have Watch expressions.

I never thought of using a Computed property in lieu of a Watch expression. Great tip!

@Michael Diehr you should consider starting a separate conversation for that very useful tip as it’s not really related to this one. It will make it easier to find later.

I do use this method (rename the property/method) and find it quite useful. Just make sure you don’t have a property or method with the same name in a wider scope. I know that’s generally considered poor form, but the compiler won’t catch it and your program could misbehave.

Good point. I usually add three x’s to the end of the name, something I’d never do normally.

And, are-we able to copy the resulting locations (intentional errors) to make a reminder document ?
Or only a less usable screen shot ?

The compiler might flag it for inappropriate content … :wink:

Just compile for all platforms? You could do that with an IDE script as well as you might also want to compile ARM, 32 & 64 bit versions to match TargetARM, Target32Bit and Target64bit.

Well sure, but if you’re in the middle of debugging something that is a little extreme and could be time consuming depending on computer and plugins and whatnot. I was just pointing out a potential gotcha with Kem’s original approach.

I wasn’t putting down your idea, but simply offering a way to build everything automatically.