Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Experimenting with a "StringList" type for simpler handling of string arrays/lists
#5
I use User Defined Types a lot these days, but I'm very disappointed of the lack of ability for a UDT to accept arrays. Another disappointment is the inability to preserve multidimensional arrays.

Let's say we want to make a tabbed program like a browser. Hmm, we switch tabs, but we want to run the same routine, but with different values. Well global or shared multi-dim arrays would allow use to do so... a$(1, n) ,a$(2, n), but if we needed to increase or decrease the array size(s), we would need a make a subroutine. That's doable enough, but it's a shame _Preserve doesn't work with multi-dims. (I use _Preserve on single-dim arrays extensively, and it's very much appreciated). Now a different route is we make everything universal using UDTs and pass those and any needed single-dim arrays to the sub calls. No need for global/shared. We still have two tabs that need to remember different variable values, and now the only way to accomplish this is a memory subroutine when switching tabs. It would either have to use _Mem or contain its own equivalent arrays to memorize the values assigned to each variable in both tabs. Upon switching, it would repopulate all the arrays and UDT variables to the active tab, while retaining the other tab values for switching back. Without using the _mem feature, this would best be done with local single-dim arrays, unless the program uses multi-dim arrays when, again, we'd have that extra preserve subroutine to make for the missing multi-dim _Preserve function. I figure we could name this sub the: MyPITA_Routine

Just sayin'

Pete
Reply


Messages In This Thread
RE: Experimenting with a "StringList" type for simpler handling of string arrays/lists - by Pete - 12-16-2025, 04:29 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Sub not Reconizing Dim as String pmackay 18 1,476 10-16-2025, 03:32 PM
Last Post: pmackay
  for performance, what's the best variable type to use for boolean _TRUE & _FALSE ? madscijr 12 1,257 09-29-2025, 02:59 PM
Last Post: dakra137
  Using modulo to loop through lists fistfullofnails 3 723 09-03-2025, 11:50 PM
Last Post: fistfullofnails
  Loading from file into _MEM? and LEN a TYPE... Unseen Machine 9 976 08-03-2025, 02:55 AM
Last Post: SMcNeill
  Illegal string-number conversion Herve 7 774 07-07-2025, 09:53 AM
Last Post: a740g

Forum Jump:


Users browsing this thread: 1 Guest(s)