Unused functions in files or projects

This forum is for ideas and or code to be contributed for general use.
Post Reply
Message
Author
Wolfgang Ciriack
Posts: 478
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Unused functions in files or projects

#1 Post by Wolfgang Ciriack »

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.
Attachments
V1.1.0e.zip
(67.79 KiB) Downloaded 1018 times
_______________________
Best Regards
Wolfgang

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Unused functions in files or projects

#2 Post by rdonnay »

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
The eXpress train is coming - and it has more cars.

bwolfsohn
Posts: 648
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

Re: Unused functions in files or projects

#3 Post by bwolfsohn »

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)}
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

User avatar
hz_scotty
Posts: 107
Joined: Thu Jan 28, 2010 8:20 am
Location: Wr.Neustadt / Österreich

Re: Unused functions in files or projects

#4 Post by hz_scotty »

hello bwolfsohn,

have you a
function popup_commchooser(aLocals,aRates_,getlist,@cEditMode)
defined?
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

Wolfgang Ciriack
Posts: 478
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: Unused functions in files or projects

#5 Post by Wolfgang Ciriack »

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.
Attachments
V1.1.0e.zip
(67.76 KiB) Downloaded 990 times
Last edited by Wolfgang Ciriack on Fri Aug 01, 2014 2:27 pm, edited 1 time in total.
_______________________
Best Regards
Wolfgang

bwolfsohn
Posts: 648
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

Re: Unused functions in files or projects

#6 Post by bwolfsohn »

hz_scotty wrote:hello bwolfsohn,

have you a
function popup_commchooser(aLocals,aRates_,getlist,@cEditMode)
defined?
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)
Wolfgang,

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

Wolfgang Ciriack
Posts: 478
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: Unused functions in files or projects

#7 Post by Wolfgang Ciriack »

Hi Brian,
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)}
and

Code: Select all

static function popup_commchooser(aLocals,aAllRates_,aGetlist,cEditMode)
return
in a file and tested it, it shows me 1 Hit which seems to be correct.
_______________________
Best Regards
Wolfgang

bwolfsohn
Posts: 648
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

Re: Unused functions in files or projects

#8 Post by bwolfsohn »

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...
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

Wolfgang Ciriack
Posts: 478
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: Unused functions in files or projects

#9 Post by Wolfgang Ciriack »

you can send me the file to ciriack_at_ciju_dot_de.
_______________________
Best Regards
Wolfgang

Wolfgang Ciriack
Posts: 478
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: Unused functions in files or projects

#10 Post by Wolfgang Ciriack »

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
Attachments
V1.1.1.zip
(73.93 KiB) Downloaded 1009 times
_______________________
Best Regards
Wolfgang

Post Reply