06-08-2025, 09:23 PM
(06-08-2025, 05:24 PM)madscijr Wrote: Thanks. That makes sense.That could be reasonable to add, it's actually fairly hard to implement yourself since you can't just take in a generic "array", it has to be of a specific type (of course, internal QB64 commands don't have this problem). That said, for most use-cases just using a regular loop is honestly fine.
So how about they add a new native QB64PE command called MoveArrayElements(MyArray, SourceStartElementIndex, SourceEndElementIndex, DestIndex) that uses the memory method under the hood? Then the compiler does not need to try and determime what the source code is doing, it's now just a straightforward command.
(Or, I suppose we could create a user-defined function that does the same, with whatever checks to make sure the values are valid. Either way, in the spirt of BASIC, to keep life simple and save the programmer from having to worry about low level headaches like worrying about how many bytes a variable uses, etc. If we don't mind that low-level stuff, we might as well be coding in C!)