[Gambas-user] Swap function for arrays

d4t4full at gmail.com d4t4full at gmail.com
Wed Jun 6 11:16:38 CEST 2018


I guess SWAP or EXCHANGE would better represent the intention of exchanging two items or blocks of items.

zxMarce.


On Jun 6, 2018, 05:09, at 05:09, Rolf-Werner Eilert <rwe-sse at osnanet.de> wrote:
>Ever so often I have to pick an entry from an array or a table and set 
>it to another position. Mostly this happens when the GUI offers an 
>upward and downward button.
>
>Each time I have to find a practical solution for my code, invent the 
>wheel if you want so, to
>
>- store the contents of the array
>- put it to its new position
>- delete it at its old position
>
>So a ready-made function for this would be nice, and alongside we could
>
>even have a broader concept by allowing for whole blocks to be pushed.
>
>Don't know which word is best for this in English, maybe push or skip
>or 
>slide... If it was push, it might be used like
>
>myArray.Push(FromPosition, ToPosition, Length)
>
>What do you think?
>
>Regards
>Rolf
>
>----[ Gambas mailing-list is hosted by https://www.hostsharing.net
>]----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20180606/f0b44e4b/attachment-0001.html>


More information about the User mailing list