Posts: 3,978
Threads: 177
Joined: Apr 2022
Reputation:
220
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: 1,586
Threads: 59
Joined: Jul 2022
Reputation:
52
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: 734
Threads: 30
Joined: Apr 2022
Reputation:
43
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.
Tread on those who tread on you
Posts: 734
Threads: 30
Joined: Apr 2022
Reputation:
43
@bplus
Yeah, variable length strings work in UDTs. I was talking about MEMGET on a UDT that has variable length strings.
Tread on those who tread on you