NameCheck

Anything QL Software or Programming Related.
User avatar
dilwyn
Mr QL
Posts: 2753
Joined: Wed Dec 01, 2010 10:39 pm

NameCheck

Post by dilwyn »

Decided to create a new thread for this rather than continuing to hijack Norman's CPORT thread.

Did some more work on the NameCheck program, hopefully taking it more in the direction of what Steve wanted, to semi-automate the checking of names used in your BASIC program against a list of names used in various toolkits. It now provides a variety of ways of checking if variable and/or procedure names in your program are used in toolkits listed in the "namessc"_txt file.

Now has a menu to let you choose whether to:

1. Scan the nametable for a list of names you are using and compare this against the namessc_txt file.
2. Scan a QREF listing, by extracting the variable/proc/fn names and comparing against namessc_txt.
3. Let you enter a single name to check if that specific name is an entry in namessc_txt

namecheck_bas is still in BASIC. It needs Toolkit 2 and Turbo Toolkit. Currently setup to find the names list namessc_txt on RAM1_ but you can change that in line 170.

As I'm still working on it, I haven't compiled it yet. It seems to work in a daughter SBASIC, allowing option 1 to scan the nametable for the current program. Hopefully, as it uses code from my BASIC Reporter, it will, once finished and compiled, be a job which runs alongside BASIC which you can use to test names as you develop your program.

I ran out of time today, but the next steps will be to add to option 1 a feature which also lists the line numbers in which the names listed are used, again using routines lifted from BASIC Reporter, to avoid reinventing the wheel.
namecheck02.zip


User avatar
BSJR
Trump Card
Posts: 182
Joined: Sun Oct 18, 2015 12:53 pm
Location: Amsterdam
Contact:

Re: NameCheck

Post by BSJR »

Thanks Dilwyn for taking up the NameCheck challenge.
I have not yet tested this but for any PE programmers there is also HyperHelp, a tool originally from Jochen's JMS that I use a lot for a quick keyword and syntax check, but its status is unknown.
dilwyn wrote:This list is taken from a file on Wolfgang Lenerz's website (also on my site, but not sure which is more recent) at http://www.wlenerz.com/smsqe/addkeys.html
I did some digging into this list on the official SMSQ site.
As your site states, the original list was done by Alex Wells &Francois van Emelen and also put in a DBAS database: Keywordsv21_dbs.
I updated this and version 22 it was part of the SuQcess1 (v1.20) for QDOS package in 2012.
A later update (version 23) was converted to html for the SMSQ website in April 2014.
Unknown is if Wolfgang did any update on this html before you converted that to .doc & .pdf.
Further updates to my original database has been done and given time I will check this against the current addkeys.html to also update that.

BSJR


User avatar
dilwyn
Mr QL
Posts: 2753
Joined: Wed Dec 01, 2010 10:39 pm

Re: NameCheck

Post by dilwyn »

Thanks Bob.
I daresay anyone prepared to invest the time and effort could go through the list Norman pointed us to, in order to update the list of there is anything new there. I also noticed that some entries in the list of Wolfgang's site have the name type listed as '-' (e.g. some of the DJToolkit extensions), which could be updated.

Have some unexpected time on my hands today so with luck NameCheck might get another update by this evening.


Derek_Stewart
Font of All Knowledge
Posts: 3928
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: NameCheck

Post by Derek_Stewart »

Hi,

I did some QD Hyperhelp for the Qptr, Easypointer, Dbas toolkits, which displays the comand syntax in QD using the Help key, when a SBASIC programme is loaded into QD for editing.

See:
viewtopic.php?f=3&t=3437#p36141


Regards,

Derek
stevepoole
Super Gold Card
Posts: 712
Joined: Mon Nov 24, 2014 2:03 pm

Re: NameCheck

Post by stevepoole »

Hi Dilwyn,

I will download your program and try it tomorrow afternoon, when I will have some spare time.

To what extent do we neeed to include ALL toolkits ? (Or just the common ones ? )

Many thanks for your long continued QL support....

Steve.

_____________________


User avatar
dilwyn
Mr QL
Posts: 2753
Joined: Wed Dec 01, 2010 10:39 pm

Re: NameCheck

Post by dilwyn »

As the names list file is just a plain text file arranged into three columns separated by semi-colons, it can be updated to include as few or as many common ones as you like just by using a plain text editor.


User avatar
dilwyn
Mr QL
Posts: 2753
Joined: Wed Dec 01, 2010 10:39 pm

Re: NameCheck

Post by dilwyn »

Today's update of NameCheck.
Now, when you do a scan using option 1 it also scans the entire BASIC program and lists the line numbers in which the names which are listed in namessc_txt are used, so that you have a list of where the name is used to manually rename the offending variable or proc/fn names.

The code is a bit clumsy and only tried on QPC2. It is prone to error, so don't expect too much from this version.

When fully debugged, next stage will be to add better use of colour, option to print to printer or file, and then produce a config block for a compiled version. Possibly speed it up a bit and add option not to list the line numbers, as that's what's slowing it down atm, and also makes the screen output look too busy-busy.

When I first started thinking about this, I thought that while the suggestion was a good idea (thanks Steve!), I feared it would be impractical or just plain too slow to do all the searching, scanning and comparing. I'm actually starting to find it quite useful myself (what's this, a software author who admits to using his own software? :ugeek: )

As before, needs Turbo Toolkit and Toolkit 2. namessc_txt should be in RAM1_ unless you amend line 170. Runs in a daughter SBASIC on QPC2.
namecheck03.jpg
namecheck03.zip


User avatar
BSJR
Trump Card
Posts: 182
Joined: Sun Oct 18, 2015 12:53 pm
Location: Amsterdam
Contact:

Re: NameCheck

Post by BSJR »

stevepoole wrote: To what extent do we neeed to include ALL toolkits ? (Or just the common ones ? )
If your program will be compiled only conflicting names currently present need to be avoided.
If it will be run in S*Basic on unknown systems All names should be checked for but I fear that such a list will always be incomplete.

BSJR


stevepoole
Super Gold Card
Posts: 712
Joined: Mon Nov 24, 2014 2:03 pm

Re: NameCheck

Post by stevepoole »

Hi Dilwyn,

I have tried your program which seems to work OK under QPC2.

But I expected it would check ANY QL_bas program against your name list. Maybe you have this planned ?

Perhaps such a user_bas listing could be merged onto your code ?

Keep up the good work....

and thanks so far,

Steve.
______________________


stevepoole
Super Gold Card
Posts: 712
Joined: Mon Nov 24, 2014 2:03 pm

Re: NameCheck

Post by stevepoole »

Hi Again Dilwyn,

Last time around, the program halts giving '750 array index out of range'.

the 'm' value is too big ....

Steve.
_______________________


Post Reply