[Gambas-user] Swap function for arrays

Rolf-Werner Eilert rwe-sse at osnanet.de
Wed Jun 6 17:18:17 CEST 2018


Thank you Charlie, that's interesting! I tried to do right this, but 
forgot the [0], so it wouldn't run.

Will try right now...

Regards
Rolf


Am 06.06.2018 um 16:29 schrieb Charlie Ogier:
> Try this. It will correct the "8" & "7" in one line: -
> 
> *Public Sub Form_Open()**
> **Dim sArray As String[] = ["0", "1", "2", "3", "4", "5", "6", "8", "7", 
> "9"] **
> **
> **sArray.add(sArray.Extract(7)[0], 8)**
> **
> **Print sArray.Join(" ")**
> **
> **End**
> *
> Charlie
> 
> 
> On 06/06/18 10:41, Rolf-Werner Eilert wrote:
>>
>> Am 06.06.2018 um 11:16 schrieb d4t4full at gmail.com:
>>> I guess SWAP or EXCHANGE would better represent the intention of 
>>> exchanging two items or blocks of items.
>>>
>>> zxMarce.
>>
>> I thought so too, but... after all, it's not a swapping or exchanging, 
>> I don't want to exchange or swap TWO items but only set ONE item to a 
>> new position.
>>
>> Hard to find a word for it. In German it is "verschieben" whereas 
>> "schieben" means "to push" and "ver..." means "away" or "to another 
>> place".
>>
>> Maybe "move" would match it?
>>
>> Regards
>> Rolf
>>
>>
>>
>>
>> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
> 
> 
> 
> 
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
> 



More information about the User mailing list