Ok, here is the most important file I have in Pan 6. It’s called Compare Names.
I do golf databases in which I put records of each tournament via a player’s score. So there is this database called 2022 golf database in which there are 10 golf tournaments with 150 players in each tournament, so at the end of the year, I have a database with 1,150 records.
So I now want to group each player’s records in the 2022 database over the year. So let’s say I want to look at 20 players’ records, again, some may have only played once, but others may have played in as many as ten events over the year.
So I have my main 2022 database that has 1,150 scores. The most important field is the player’s name, which I call “NAME” The rest of the database has information on each player’s score in the four-round event and the money he won. I also have other information that is important to me, but again each record has the most important element, which is the field “NAME.”
My second database is called “Compare Names.”
The first field is Missing Names.
Now someone wrote this program for me about 20 years ago, and I have never questioned it or tried to figure it out again because it has worked so well for 20 years.
What I am doing with this Compare Names database is being able to open up a text file that has the names of the 20 players I want to select from the 2022 database. So in the text file I select the 20 or so players and it gets put on my clipboard.
In the Compare Names database, I run a procedure that seems to have two items in it
.Initialize
Compare Names.
So here is the formula that seems to run this:
First for .Initialize:
Global gvNames gvNames=""
Then there is the Compare Names formula that runs this:
Global gvNames
Clipboard = replace(Clipboard()," ",¶)
gvNames = arraystrip(Clipboard(),¶)
ArrayFilter gvNames,gvNames,¶,strip(import())
Global folder,file,type
OpenFileDialog folder,file,type,""
If file = “” Stop Endif
OpenFile pathstr(folder)+file
Local cycles cycles = 1
Loop
Select NAME = array(gvNames,cycles,¶)
cycles = cycles+1
Until info(“Empty”) = 0 or cycles = arraysize(gvNames,¶)
If cycles = arraysize(gvNames,¶) and info(“Empty”) = -1
Message “None were found.”
Stop
EndIf
Loop
SelectAdditional NAME = array(gvNames,cycles,¶)
cycles = cycles+1
Until cycles = arraysize(gvNames,¶)
Local lvNames ArrayBuild lvNames,¶,"",NAME
ArrayFilter gvNames,gvNames,¶,?(lvNames contains import(),"",Import())
gvNames = arraystrip(gvNames,¶)
WindowtoBack info(“WindowName”)
Showvariables gvNames
OpenFile “&@gvNames”
So I have on the clipboard the 20 NAMES I am looking to select in my 2022 database.
I run the action called Compare Names, and sure enough, on the 2022 database, the 20 names are selected.
Hopefully, someone can help me with this???
Thanks