B4A Question LIST2 = SHUFFELIST(LIST1) also changes LIST1, Why? - klaus (first post)    Apr 22, 2018   (2 reactions) From the List help:
List.Initialize2
Method
Initializes a list with the given values. This method should be used to convert arrays to lists.
Note that if you pass a list to this method then both objects will share the same list,
and if you pass an array the list will be of a fixed size. Meaning that B4J Question [XLUtils] Reorder sheets - Erel (first post)    Jul 11, 2021   (1 reaction) Tip - List.Initialize2 is never really needed. It is the same as: Dim sheetslist As List = sheets Bug? List.Initialize2 and Array [SOLVED, I've should've read the documentation] - Erel (first post)    Sep 14, 2016   (1 reaction) Check List.Initialize2 documentation: https://www.b4x.com/b4j/help/collections.html#list_initialize2 B4J Question [ABMaterial][WebSockets]How can I access all websockets that share the same session? - Erel (first post)    Oct 30, 2016   (1 reaction) See the documentation of List.Initialize2. B4A Library [B4X] PlusCodes Library - mading1309 (first post)    Aug 26, 2024   (3 reactions) Initialize2 (Array As String ("9C3W9QCJ+2VX", "9QCJ+2VX")) shortCodes(7).Initialize2 (Array As String ("9C3W9QCJ+2VX", "9QCJ+2VX")) shortCodes(8).Initialize2 (Array As String ("9C3W9QCJ+2VX", "9QCJ+2VX")) shortCodes(9).Initialize2 (Array As String ("8FJFW222+", "22+")) shortCodes(10) B4A Question list Initialize2 - same as stuffing array in? - Peter Simpson (first post)    Jan 18, 2020 In one wee word @Albert Kallal , yes... Bug? [B4A 4.30] - List.Clear [EDIT - NO BUGS] - Roycefer (first post)    Jan 05, 2016   (1 reaction) That's not a bug. In the comments for the Initialize2 method, this is explained. If you pass an Array to this method, then the resulting List will be of fixed size and you can't add or remove items. B4J Question Adding a value to a list results in a UnsupportedOperationException - stevel05 (first post)    Jan 14, 2021   (5 reactions) Because Initialize2 creates a fixed size list. The same as if you do:
Dim l As List = Array("Test","Test")
l.Add("Test")
You need to do:
Dim NewList As List
NewList.Initialize
NewList.AddAll(PreviousList)
NewList.Add(NewValue) B4A Question jsonparser or replace - Erel (first post)    Jun 22, 2015 JsonGenerator.Initialize2 accepts a List. B4A Library Geocoder library - qnw4ts7pge (first post)    Jun 27, 2017 Interesting.... Your reply got me thinking.
I was assuming that the list.initialize2 method was basically doing the following, but when I code it explicitly, it works.
Changed this:
FoundAddresses.Initialize2(Results)
To this:
If FoundAddresses.IsInitialized Then
FoundAddresses.Cle Page: 1   2   3   4   5   6   7   Powered by ColBERT |