Code: Select all
Void$ = List(INDEX)\Period$
Code: Select all
SelectElement(List(), INDEX)
Void$ = List()\Period$
Sorry if I bother you with my suggestions. These are just things I don't like and make programming cumbersome.
Code: Select all
Void$ = List(INDEX)\Period$
Code: Select all
SelectElement(List(), INDEX)
Void$ = List()\Period$
What you describe is an Array !?Splunk wrote: Fri Mar 10, 2023 2:57 pm It would be nice to be able to address list items directly with the list index
No this is a different story.Splunk wrote: Fri Mar 10, 2023 2:57 pm I remember that the file handling in the earlier PureBasic versions still had the cumbersome method like "UseFile()". This was then also rationalized away. SelectElement() probably also falls into this category.
An array is probably a more suitable solution.Splunk wrote: Fri Mar 10, 2023 2:57 pm These are just things I don't like and make programming cumbersome.
Yes of course. But this is no index in this way, that you have "direct" access to the element.Splunk wrote: Fri Mar 10, 2023 3:40 pm An INDEX argument could be handled internally by PB as SelectElement().
Each time you write List(INDEX) the whole list is iterated until INDEX.SelectElement() wrote:Remarks
As lists don't use an index internally, this function will jump compulsory to every element in the list until the target position is reached which will take time if the list is large.
Exactly
Ok, I'm fine with this. We both made our point of view clear.
Of course I did, I would lie otherwise.Splunk wrote: Fri Mar 10, 2023 5:20 pm I don't think you've never used the SelectElement() function because it's so "dangerous" or slow.