Results 1 to 8 of 8

Thread: [RESOLVED] VB ADD-INS for analyzing variable names

  1. #1

    Thread Starter
    The Idiot
    Join Date
    Dec 2014
    Posts
    2,721

    Resolved [RESOLVED] VB ADD-INS for analyzing variable names

    I never use Add-Ins, but reading around I understand people are using it.
    one Add-ins that I would love to have is something like this:

    - a variable analyzer
    will check all variables, public or private and see if those are used at all and if different modules uses the same variable and inform me theres a doublet.

    - a function name and variable analyzer
    like the above, if a function, private or public is used in another module, if so, inform me as well, and also, if variables used inside the functions are also used as module variables

    example:
    Code:
    module1
    Dim MyVar as Long
    Dim ThatVar as Integer
    Public OtherVar as Long
    Public SameVar as Long
    
    Function MyFunc()
    Dim MyVar as Long
    OtherVar = OtherVar + 1
    End Function
    
    module2
    Dim MyVar as Long
    
    Function AnotherFunc()
    Dim SameVar as Integer
    
    SameVar = SameVar + 1
    End Function
    a report will tell:
    MyVar is found in module1, module2, module1(MyFunc)
    OtherVar in module1 is a Public variable but only used in module1
    SameVar in module1 is a Public variable a doublet conflict in module2(AnotherFunc) could cause errors.
    ThatVar in module1 is never used.

    and so on.
    is there ADD-INS that have this?

  2. #2
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,853

    Re: VB ADD-INS for analyzing variable names

    Hi Baka,

    I'm not sure it takes an Add-In to do this. In fact, if I were to do it, I'd definitely get it running as a regular program first, and then maybe think about making it an Add-In. And LaVolpe's Project Scanner comes pretty close to getting this done.

    Best Regards,
    Elroy
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  3. #3
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,872

    Re: VB ADD-INS for analyzing variable names

    Have a look at MZTools, it doesn't do everything you asked for, but does dead code and unused variables.

    Also handy:
    https://www.vbforums.com/showthread....-Addin-for-VB6

    And the Callers AddIn by RDE, came from PSC:
    https://www.vbforums.com/showthread....=1#post5409319

  4. #4
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: VB ADD-INS for analyzing variable names

    Quote Originally Posted by Elroy View Post
    And LaVolpe's Project Scanner comes pretty close to getting this done.

    Best Regards,
    Elroy
    That project can perform those tasks. But the task of identifying duplication; only if under one condition... The duplicated variables and functions are public or (in same scope of the code page and declared in the declarations section). For example, "Dim I As Integer" will not flag that variable as 'duplicated' if it is a local declaration to a method/property, regardless how many methods use same declaration. I felt that type of specific check was literally a waste of time IMO.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  5. #5

    Thread Starter
    The Idiot
    Join Date
    Dec 2014
    Posts
    2,721

    Re: VB ADD-INS for analyzing variable names

    Hi Elroy

    I did try it and its very useful.
    got a bunch of results so I can clean up a bit.
    usually its when I update a function and I leave the "old" stuff and forget to remove it.

  6. #6
    Fanatic Member
    Join Date
    Jan 2015
    Posts
    596

    Re: VB ADD-INS for analyzing variable names

    Yes, LaVolpe's project can do it, and in combination with VBIDEUtils (addin open source now), you could find nearly everything
    I use both for my projects

  7. #7
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: VB ADD-INS for analyzing variable names

    Quote Originally Posted by baka View Post
    ...usually its when I update a function and I leave the "old" stuff and forget to remove it.
    One of the reasons I designed it -- applies to all of us. For me, I tend to have test code (methods & variables) that are left behind and never used again after testing. In smaller projects, those are easy to see. But in large projects, they can get 'lost'. That tool can help find those too.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  8. #8
    Fanatic Member
    Join Date
    Jan 2015
    Posts
    596

    Re: [RESOLVED] VB ADD-INS for analyzing variable names

    NB : For testing, I always tag like ' ######
    So I can do a search for the string to remove the uneeded lines

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width