Jump to content
Mike Torrettinni

Is it possible to get a list of all global variables, consts, types (non RTL)?

Recommended Posts

Part of refactoring process and removing global variables I try to create units/classes that have as little as possible exposed to public. Of course this is not always possible, at least with enums.

For a big project, where checking each unit is tedious work, is there a way I can get a list of all accessible global variables, consts, types, from current main form unit? I would like to see what is in the public/global accessible area.

 

I hope this could also help me prepare my project for LSP or code insight in 10.5 as I suspect my projects fail because of so much stuff in global reach.

 

Perhaps a third party tool can compile such list?

Share this post


Link to post
1 hour ago, FPiette said:

Try Pascal Analyser Lite.

Thanks, I have a full version but the report is for the whole project and not limited in scope from the main form. Great tool, but hard to pin point specifics when results are for the full project.

 

Was hoping for some more specific tool/way to achieve this.

Share this post


Link to post
21 minutes ago, Mike Torrettinni said:

Thanks, I have a full version but the report is for the whole project and not limited in scope from the main form. Great tool, but hard to pin point specifics when results are for the full project.

 

Was hoping for some more specific tool/way to achieve this.

I have found it necessary to write small apps to derive what I need from reports out of PAL. The noise level is quite high, and the options do not address things I have needed.

  • Like 1

Share this post


Link to post
18 minutes ago, Bill Meyer said:

I have found it necessary to write small apps to derive what I need from reports out of PAL. The noise level is quite high, and the options do not address things I have needed.

That make sense, perhaps I will do he same thing. At least some filtering results per unit and type of result.

Share this post


Link to post
1 hour ago, Mike Torrettinni said:

That make sense, perhaps I will do he same thing. At least some filtering results per unit and type of result.

Your other alternative is to roll your own with DelphiAST. But there is a lot involved, since it only processes a single unit at a time. Then you have to harvest the items of interest, put them into datasets or something, and repeat for all the other units.

Share this post


Link to post
Posted (edited)

As a slightly crazy but working option I could advice to generate documentation with PasDoc. It will show you all public items in processed units. It also could generate machine-friendly XML for further processing

Edited by Fr0sT.Brutal
  • Thanks 1

Share this post


Link to post
11 hours ago, Bill Meyer said:

Your other alternative is to roll your own with DelphiAST

Hm, probably not worth getting into this for what I need, but I never really looked into it so perhaps is really easy.

 

43 minutes ago, Fr0sT.Brutal said:

As a slightly crazy but working option I could advice to generate documentation with PasDoc.

Thanks, it's pretty extensive report, I think I used PasDoc many many years ago. Perhaps even early beta release, since it's been around since 2008.

Share this post


Link to post
9 hours ago, Mike Torrettinni said:

Hm, probably not worth getting into this for what I need, but I never really looked into it so perhaps is really easy.

I've done only a little with it. Works well, and how hard it is depends on how much you need to harvest.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×