Posts: 2,700
Threads: 124
Joined: Apr 2022
Reputation:
134
03-01-2023, 04:00 PM
(This post was last modified: 03-01-2023, 04:00 PM by bplus.)
You folks have sure wandered far from the main subject problem of OP.
Associative arrays really aren't a solution to arrays of arrays but are an interesting topic on their own.
TempodBasic and I have kicked them around with a Rosetta Code Challenge on the old forum.
Too bad a new thread on that subject was not started.
b = b + ...
Posts: 31
Threads: 0
Joined: Apr 2022
Reputation:
5
Now that this thread is 6 pages long, here comes a bucket of saltwater: Linked Lists
Look them up anywhere but here.
Posts: 1,510
Threads: 53
Joined: Jul 2022
Reputation:
47
Not much different from handling associative arrays the "traditional" way.
However it's possible now with the _MEM gang. Copy that old source code from Turbo Pascal, however in QB64(PE) the pointer is always neutral. I don't know if the _MEMGET and _MEMPUT syntax works with UDT "as <type>" being the final parameter.
Might be able to arrange it coding in C++, and write subprograms in QB64(PE) to make a request to add an element, to count the number of list elements, to change the reference of one of the members, and so forth. The trade-off is that the programmer might have to hard-code the UDT to make it simpler.
Posts: 439
Threads: 17
Joined: Apr 2022
Reputation:
21
I have no problem with MEM being used but in my opinion it should always be used with MEMGET instead of some weird algorithm for accessing the data within. To my knowledge, MEMGET does work with UDTs. You just can't have any variable-length strings in the UDT or else it won't work right.
Ask me about Windows API and maybe some Linux stuff
Posts: 439
Threads: 17
Joined: Apr 2022
Reputation:
21
@bplus
Yeah, variable length strings work in UDTs. I was talking about MEMGET on a UDT that has variable length strings.
Ask me about Windows API and maybe some Linux stuff