Unused functions in files or projects
-
- Posts: 484
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
Unused functions in files or projects
Hi all,
inspired from the prog grok (Mark J. Carew, 2004) i decided to rewrite it for my needs. I removed the Database use and use an array for this, so the prog needed only 75 seconds instead of 1150 seconds for the same xpj-file. Inspired from some testers in the german forum and from my own needs i added a parameter check, a result viewer, Export to XLS, CSV, DBF and ARRAY, Import from saved ARR files and some things more.
Feel free to check and change it to your needs.
It can be configured for german and english.
Thanks to Roger for his great eXPress++ functions, so it was a lot easier to realize this. The xBaseTools libraries are needed, too.
Have fun.
inspired from the prog grok (Mark J. Carew, 2004) i decided to rewrite it for my needs. I removed the Database use and use an array for this, so the prog needed only 75 seconds instead of 1150 seconds for the same xpj-file. Inspired from some testers in the german forum and from my own needs i added a parameter check, a result viewer, Export to XLS, CSV, DBF and ARRAY, Import from saved ARR files and some things more.
Feel free to check and change it to your needs.
It can be configured for german and english.
Thanks to Roger for his great eXPress++ functions, so it was a lot easier to realize this. The xBaseTools libraries are needed, too.
Have fun.
- Attachments
-
- V1.1.0e.zip
- (67.79 KiB) Downloaded 1300 times
_______________________
Best Regards
Wolfgang
Best Regards
Wolfgang
Re: Unused functions in files or projects
Wolfgang -
This looks like good work.
I ran it against all the PRGs in \exp19\source\dclipx folder.
What does the Parameter - error column mean?
Roger
This looks like good work.
I ran it against all the PRGs in \exp19\source\dclipx folder.
What does the Parameter - error column mean?
Roger
The eXpress train is coming - and it has more cars.
Re: Unused functions in files or projects
Wolfgang,
Looks interesting..
the only issue(s) i've found (so far) is it is falsely reporting myhandler is not being called from this construct in the same .prg
DCREAD GUI ;
HANDLER myhandler ;
OPTIONS GetOptions ;
FIT ;
TITLE "Real-Time Sale Viewing" ;
*****************
STATIC FUNCTION myHandler( nEvent, mp1, mp2, oXbp, oDlg, GetList )
and also falsely report popup_commchooser is not being called.
@ nRow, .5 DCPUSHBUTTON PARENT oCommissions;
CAPTION "Set Default ;Commission" FONT cFont ALIGNCAPTION BS_MULTILINE;
SIZE 10.5,2 OBJECT oDefaultCommissionButton ;
ACTION {||popup_commchooser(aLocals,aRates_,getlist,@cEditMode)} ;
WHEN {||cEditMode='V' .AND. !empty(LOCALCONSIGNOR_RATES)}
Looks interesting..
the only issue(s) i've found (so far) is it is falsely reporting myhandler is not being called from this construct in the same .prg
DCREAD GUI ;
HANDLER myhandler ;
OPTIONS GetOptions ;
FIT ;
TITLE "Real-Time Sale Viewing" ;
*****************
STATIC FUNCTION myHandler( nEvent, mp1, mp2, oXbp, oDlg, GetList )
and also falsely report popup_commchooser is not being called.
@ nRow, .5 DCPUSHBUTTON PARENT oCommissions;
CAPTION "Set Default ;Commission" FONT cFont ALIGNCAPTION BS_MULTILINE;
SIZE 10.5,2 OBJECT oDefaultCommissionButton ;
ACTION {||popup_commchooser(aLocals,aRates_,getlist,@cEditMode)} ;
WHEN {||cEditMode='V' .AND. !empty(LOCALCONSIGNOR_RATES)}
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Re: Unused functions in files or projects
hello bwolfsohn,
have you a
Where is it? in a source.prg or in a Library?
if it is in a program it will be found it count right
(tested by myself)
have you a
defined?function popup_commchooser(aLocals,aRates_,getlist,@cEditMode)
Where is it? in a source.prg or in a Library?
if it is in a program it will be found it count right
(tested by myself)
best regards
Hans
Hans
-
- Posts: 484
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
Re: Unused functions in files or projects
Hi Roger,
thanks. In the error column are written the file names and the parameter check errors, f.e. defined is test(a,b,c) and i found test(a,b,,c) there is a parameter count fault 4<>3. I know, that the parameter check is not complete, the knowing hints are in the source.
Hi Brian,
i found all the HANDLER functions in my project as not used, too. I do not know if it is also possible to use HANDLER myhandler(). Roger ?
Perhaps i can handle this as an exception like the function calls in strings.
Here is an Update (without version change) because of a bug with loading the ini file.
thanks. In the error column are written the file names and the parameter check errors, f.e. defined is test(a,b,c) and i found test(a,b,,c) there is a parameter count fault 4<>3. I know, that the parameter check is not complete, the knowing hints are in the source.
Hi Brian,
i found all the HANDLER functions in my project as not used, too. I do not know if it is also possible to use HANDLER myhandler(). Roger ?
Perhaps i can handle this as an exception like the function calls in strings.
Here is an Update (without version change) because of a bug with loading the ini file.
- Attachments
-
- V1.1.0e.zip
- (67.76 KiB) Downloaded 1233 times
Last edited by Wolfgang Ciriack on Fri Aug 01, 2014 2:27 pm, edited 1 time in total.
_______________________
Best Regards
Wolfgang
Best Regards
Wolfgang
Re: Unused functions in files or projects
Wolfgang,hz_scotty wrote:hello bwolfsohn,
have you adefined?function popup_commchooser(aLocals,aRates_,getlist,@cEditMode)
Where is it? in a source.prg or in a Library?
if it is in a program it will be found it count right
(tested by myself)
yes, it's in the same prg as the function which calls it.
static function popup_commchooser(aLocals,aAllRates_,aGetlist,cEditMode)
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
-
- Posts: 484
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
Re: Unused functions in files or projects
Hi Brian,
i have copied
and
in a file and tested it, it shows me 1 Hit which seems to be correct.
i have copied
Code: Select all
@ nRow, .5 DCPUSHBUTTON PARENT oCommissions;
CAPTION "Set Default ;Commission" FONT cFont ALIGNCAPTION BS_MULTILINE;
SIZE 10.5,2 OBJECT oDefaultCommissionButton ;
ACTION {||popup_commchooser(aLocals,aRates_,getlist,@cEditMode)} ;
WHEN {||cEditMode='V' .AND. !empty(LOCALCONSIGNOR_RATES)}
Code: Select all
static function popup_commchooser(aLocals,aAllRates_,aGetlist,cEditMode)
return
_______________________
Best Regards
Wolfgang
Best Regards
Wolfgang
Re: Unused functions in files or projects
wolfgang,
it's a rather large file, and it's getting lost in there somewhere... i found a number of these situations...
if you give me your email, i'll send the file directly to you for your testing..
just be aware, it's propietary code...
it's a rather large file, and it's getting lost in there somewhere... i found a number of these situations...
if you give me your email, i'll send the file directly to you for your testing..
just be aware, it's propietary code...
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
-
- Posts: 484
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
Re: Unused functions in files or projects
you can send me the file to ciriack_at_ciju_dot_de.
_______________________
Best Regards
Wolfgang
Best Regards
Wolfgang
-
- Posts: 484
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
Re: Unused functions in files or projects
Projekt-Checker Version 1.1.1, Changes:
- eXpress++ DCREADGUI... HANDLER func ... as exception for function in strings
- Parameter error changed in warning
- Added option 'Only parameter warning for more parameters as defined'
- Added Language selection, save settings (in INI file), commandline parameters for language removed
- Parameter scan corrected
- Definitions and hits of funktions over multiple lines (with ; continued lines) are considered
- Comment rows with "//" are considered from hits scanning.
- Added SQLExpressKey() und Xb2NetKey() as exceptions for functions
- eXpress++ DCREADGUI... HANDLER func ... as exception for function in strings
- Parameter error changed in warning
- Added option 'Only parameter warning for more parameters as defined'
- Added Language selection, save settings (in INI file), commandline parameters for language removed
- Parameter scan corrected
- Definitions and hits of funktions over multiple lines (with ; continued lines) are considered
- Comment rows with "//" are considered from hits scanning.
- Added SQLExpressKey() und Xb2NetKey() as exceptions for functions
- Attachments
-
- V1.1.1.zip
- (73.93 KiB) Downloaded 1229 times
_______________________
Best Regards
Wolfgang
Best Regards
Wolfgang