That's definitely a way to do it. I know I've done exactly that in one of my tables way back when (for treasure generation), but I wasn't able to find it with a quick look. There might be an example in the Files section of the group.
If I recall, the way I did it was to store the results in a dataset, and when each item was generated, I'd scan the dataset to see if it was already there. If so, I just incremented the count by one. If not, I created a new record with a count of one.
©\©\©\©\©\©\©\ Original Message ©\©\©\©\©\©\©\
On Tuesday, March 30, 2021 9:05 AM, Otaku Smurf <otakusmurfgaming@...> wrote:
toggle quoted message
Show quoted text
I am working on my own random gem table combining the 1ed DMG and articles from Dragon Magazine.
I am able to loop through my initial?table, but that is spitting out one gem at a time.? Arrays have never been my strong suit in programming, and that has me at a disadvantage here.
What I would like to do is when table generates: diamond, diamond, ruby, emerald, ruby to use the array to store and track the count of the results. so when I list out the results I can display 2x diamonds, 2x rubies, 1x emerald.
Is this possible?? I was thinking?of something like this {DSCreate~Gems, GemID, Count}??
If I were in my SQL environment, I would just create a temp table and store each individual entry, then query for the counts.??
Thanks.