Unused Variables Tool (Navision) Update

Administrator
Member, Moderator, Administrator Posts: 2,506
Unused Variables Tool (Navision)
Will help you to find and remove unused Global and Local variables. You can simultaneously search in many objects (it is desirable that the size of the Text File was no more than 10 Mb).
It can be used in versions 3. and above.
Here results of search in a database NAV3.70W1
• Table (linked to Unused Variables 370W1Tab.htm)
• Form (linked to Unused Variables 370W1 Form.htm)
• Report (linked to Unused Variables 370W1 Rep.htm)
• Codeunit (linked to Unused Variables 370W1 CU.htm)
Working method:
• Export objects in the form of the Navision Text File.
• Run Form 70100 "Unused Variables".
• Specify the path of Export File.
• Click the Variables - Search Unused.
http://www.mibuso.com/dlinfo.asp?FileID=537
Discuss this download here.
Will help you to find and remove unused Global and Local variables. You can simultaneously search in many objects (it is desirable that the size of the Text File was no more than 10 Mb).
It can be used in versions 3. and above.
Here results of search in a database NAV3.70W1
• Table (linked to Unused Variables 370W1Tab.htm)
• Form (linked to Unused Variables 370W1 Form.htm)
• Report (linked to Unused Variables 370W1 Rep.htm)
• Codeunit (linked to Unused Variables 370W1 CU.htm)
Working method:
• Export objects in the form of the Navision Text File.
• Run Form 70100 "Unused Variables".
• Specify the path of Export File.
• Click the Variables - Search Unused.
http://www.mibuso.com/dlinfo.asp?FileID=537
Discuss this download here.
0
Comments
-
Nice tool ! =D>
I just did a quick test on one of our objects and i have 1 bug and 2 sugestions for you:
bug:
- when you cancel the search variables proces, the file remains locked until you close the form (not a big issue and probably hard to overcome, but i just wanted you to know).
sugestions:
- we sometimes use variables just as a seperator, so our code remains human readable. This means that these variables are intended to be unused and should never be removed. Maybe you could add some kind of filter (that can be set by the user) to ignore variable names that meats some critearia. Like for example variables witch the character '#' in its name.
- when opening a file, check that the first 6 characters for the string "OBJECT". The first thing i did was accidentally export the object as a text file but still in binary (fob) format and the program didnt warn me ](*,)In a world without Borders or Fences, who needs Windows and Gates?0 -
Nice tool! Just ran this on a 50 object module. I'm the kind of person who *hates* globals so I've been changing globals to locals where I can. This tool found a lot of variables that weren't used any more and when I re-imported the .txt file they were all gone and everything worked. Well kind of…
My computer uses “/” as a DD/MM/YY separator so the export routine was trying to create a file called “t_Modifyed_25/11/05_1.txt”. Windows didn't like this at all so I had to add a line of code to delete the “/” – easy enough. Also, it doesn't spot locals/globals used as the value of a DataCaptionExpr property of a form.
Bottom line: I love it!
Stebbi0 -
It's a nice tool but a little bit dangerous to trust in it
I analysed 4200 lines of code and then removed the not used variables with the "delete unused" and compared the result file to the origin file.
110 lines of code were deleted...
But it helped me to find the not used variables0 -
Dangers are not present, as the new text file is created, and the original file remains without changes. You have always an opportunity to compare both of a file and to use any of them.
If you have found mistakes at removal of variables send those to me one of objects, please. It will be rather interesting for analysing. I use this tool already more than year and yet did not see any mistake.0 -
I believe that you haven't found any mistakes. But I'm building a Tool which corrects the Styleguide of *.txt files (Spaces, not allowed combinations like THEN REPEAT and so on...) with a lot of Keywords in it and i think thats the problem
E.g.:
IF ((STRPOS(ActualLineP,'On') <> 0) AND (BeetweenText(ActualLineP,'On') = FALSE)
AND (STRPOS(ActualLineP,'=VAR') <> 0) AND (BeetweenText(ActualLineP,'VAR') = FALSE))
THEN BEGIN
BeginStackG := 0;
CheckG := TRUE;
justswitchedG := TRUE;
IF STRPOS(ActualLineP,ComL) > 0 THEN
ActualLineP[STRPOS(ActualLineP,ComL)] := ' ';
END;
IF ((STRPOS(ActualLineP,'CASE ') <> 0) AND (BeetweenText(ActualLineP,'CASE') = FALSE)
AND (STRPOS(ActualLineP,'OF') <> 0) AND (BeetweenText(ActualLineP,'OF') = FALSE))
THEN BEGIN
ZeilePruefen_isCommentOpen(ActualLineP,'CASE');
keycheckL := TRUE;
IF (NOT (ZeilePruefen_isComment(ActualLineP, 'CASE')) AND ((zp_isOpenG = 2) OR (zp_isOpenG = 66) OR (zp_isOpenG = 0))) THEN
BeginStackG := BeginStackG +1;
END;
Result:
IF ((STRPOS(ActualLineP,'On') <> 0) AND (BeetweenText(ActualLineP,'On') = FALSE)
BeginStackG := 0;
CheckG := TRUE;
justswitchedG := TRUE;
keycheckL := TRUE;
BeginStackG := BeginStackG +1;0 -
I have tried this tool for several object files and it seems to work perfectly. Good work!
Anyway, I have a suggestion for improvement: a filter on variable ID's. I do not want to delete unused variables from standard navision because this the code difficult to maintain.
Kind Regards,
RonConnectivity Studio for Microsoft Dynamics NAV - Where Microsoft Dynamics NAV meets the world0 -
I agree with stebbijons with date '/' separator problem and just replace format(TODAY) by format(TODAY,6). DD/MM/YY is now YYMMDD.
I agree with ronvdw. I don't want to change standard Navision code to avoid problem with further ugrade.
I just want to delete my unused variables (with my ID).
I agree with all together : Nice tool !0 -
Unused Variables Tool (Navision) Update
Will help you to find and remove unused Global and Local variables. You can simultaneously search in many objects (it is desirable that the size of the Text File was no more than 10 Mb).
It can be used in versions 3. and above.
Working method:
• Export objects in the form of the Navision Text File.
• Run Form 70100 "Unused Variables".
• Specify the path of Export File.
• Click the Variables - Search Unused.
New version:
Added filters for Variable-ID and Variable-Name to exclude from search standard Navision variables or variables set by the user.
http://www.mibuso.com/dlinfo.asp?FileID=537
Discuss this download here.0 -
Thanks !
I wast just planning on using your tool today now i can use the new version and don't have to manually delete var names! :P \:D/In a world without Borders or Fences, who needs Windows and Gates?0 -
Great Tool.
=D>
I also Exerienced the NewFileName Error on the CodeUnit 70100.
I corrected it by Changing the Format(TODAY) code to
FORMAT(TODAY,0,'<Day,2>-<Month,2>-<Year4>').
Thanks =D>Sunday, Godwin G0 -
Great Tool! \:D/
But I have some problems with some code in Codeunits.
For that reason I have added an example:
PROCEDURE AppServer_BatchManager
VAR
SetupRec@1160230001 : Record 6010300;
BEGIN
IF ISCLEAR(Batch_Manager_Timer) THEN
CREATE(Batch_Manager_Timer);
SingleInstance.Get_SetupRec(SetupRec);
Batch_Manager_Timer.Enabled := FALSE;
Batch_Manager_Timer.Interval := 30000;
Batch_Manager_Timer.Enabled := TRUE;
in_ATASStarted := TRUE;
MESSAGE(Text001,in_Parameter,Batch_Manager_Timer.Interval);
END;
SetupRec is use within the code: SingleInstance.Get_SetupRec(SetupRec);
But the tool marks it as unused.
I did not have the time to dig in it but I would like to inform you regarding that feature.
As a suggestion I would like to ask for a function that skips objects that do not have unused variables when creating the new file.
Another solution could be in changing the Version text or to set the modified flag.
But still - it is a great tool!
Regards
Kappe___________________________________________
Kappe0 -
DO we have this tool for NAV 2017? please help!!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions