Joubarbe wrote:I’d like to delete elements without knowing the list.
This wish is a little bit confusing...
There is two context :
1) delete (or modify, insert, etc...) an element
whatever the list is, just matching the data type (string for strings list, integer for integers list, structured datas for structured datas list, etc...)
In this way, you have to store a list inside a structured buffer.
Code: Select all
Structure MyList
List E.S()
EndStructure
Define *X.MyList = AllocateStructure(*X, MyList)
; this above is equivalent to NewList()
Procedure HandleList(*This.MyList)
; here, an element or a list is accessed by *This\E()
; i.e.
AddElement(*This\E() )
*This\E() = "Hello"
EndProcedure
; here is a call
HandleList(*X)
2) Second context : delete a detailed element which is the same in several lists. In this way, all the lists which must have a element to be removed have to be argumented
Code: Select all
Remove("Test", List1(), List2() )
; call a user fonction named Remove() to remove all the occurences "Test" in List1 and in List2.
This implies a procedure must
search a specific string (ie : "Test") and remove the matching element.
This implies also a strict quantity of lists to be treatened.
Could you give more details about your wish? (1st or 2nd context, maybe a third context)