Code: Select all
Procedure Test(List x.l())
List y() = x()
EndProcedure
NewList MyList.l()
Test(MyList())
Code: Select all
Procedure Test(List x.l())
List y() = x()
EndProcedure
NewList MyList.l()
Test(MyList())
Code: Select all
Structure a4
String.s
List x.i()
EndStructure
Structure a3
List x.a4()
EndStructure
Structure a2
List x.a3()
EndStructure
Structure ax
List x.a2()
EndStructure
Procedure Test(List x.a2())
SelectElement(x(),0)
SelectElement(x()\x(),0)
SelectElement(x()\x()\x(),0)
SelectElement(x()\x()\x()\x(),0)
List y.i() = @x()\x()\x()\x()
ForEach y()
Debug y()
Next
EndProcedure
Test.ax
For i=1 To 10
If AddElement(Test\x())
For x=1 To 10
If AddElement(Test\x()\x())
For y=1 To 10
If AddElement(Test\x()\x()\x())
For z=1 To 10
If AddElement(Test\x()\x()\x()\x())
Test\x()\x()\x()\x()=z
Test\x()\x()\x()\String = Str(i)+Str(x)+Str(y)+Str(z)
EndIf
Next z
EndIf
Next y
EndIf
Next x
EndIf
Next i
Test(Test\x())
Code: Select all
*MyStruct.Point
Point.Point
Point\x=1
Point\y=2
*MyStruct = @Point
Debug *MyStruct\x
Debug *MyStruct\y
Code: Select all
Structure a4
String.s
List x.i()
EndStructure
; [...]
Protected *a4.a4 = @x()\x()\x()
ForEach *a4\x()
Debug *a4\x()
Next
Code: Select all
*Element() = Element()\Element()\Element()
I want to add this feature.STARGÅTE wrote:you can not use:
This is not possible to add, for the reason Stargate explainedUser_Russian wrote:I want to add this feature.STARGÅTE wrote:you can not use:
Why not?Polo wrote:This is not possible to add, for the reason Stargate explainedUser_Russian wrote:I want to add this feature.STARGÅTE wrote:you can not use:
Code: Select all
Structure a4
String.s
List x.i()
EndStructure
Structure a3
List x.a4()
EndStructure
Structure a2
List x.a3()
EndStructure
Structure ax
List x.a2()
EndStructure
Procedure Test(List y.i())
ForEach y()
Debug y()
Next
EndProcedure
Test.ax
For i=1 To 10
If AddElement(Test\x())
For x=1 To 10
If AddElement(Test\x()\x())
For y=1 To 10
If AddElement(Test\x()\x()\x())
For z=1 To 10
If AddElement(Test\x()\x()\x()\x())
Test\x()\x()\x()\x()=z
Test\x()\x()\x()\String = Str(i)+Str(x)+Str(y)+Str(z)
EndIf
Next z
EndIf
Next y
EndIf
Next x
EndIf
Next i
SelectElement(Test\x(),0)
SelectElement(Test\x()\x(),0)
SelectElement(Test\x()\x()\x(),0)
SelectElement(Test\x()\x()\x()\x(),0)
Test(@Test\x()\x()\x()\x())
Code: Select all
NewList x1.l()
NewList x2.l()
NewList x3.l()
NewList x4.l()
ForEach x1()
; Working with a list.
Next
ForEach x2()
; Working with a list.
Next
ForEach x3()
; Working with a list.
Next
ForEach x4()
; Working with a list.
Next
Code: Select all
Procedure Test(List x.l())
ForEach x()
; Working with a list.
Next
EndProcedure
NewList x1.l()
NewList x2.l()
NewList x3.l()
NewList x4.l()
Test(x1())
Test(x2())
Test(x3())
Test(x4())
Code: Select all
NewList x1.l()
NewList x2.l()
NewList x3.l()
NewList x4.l()
For i=1 To 4
Select i
Case 1 : List x.l() = x1()
Case 2 : List x.l() = x2()
Case 3 : List x.l() = x3()
Case 4 : List x.l() = x4()
EndSelect
ForEach x()
; Working with a list.
Next
Next i
You could use an array of Lists:User_Russian wrote:It would be great if we could get a pointer to list (not to be confused with the current element) and work with it, that is, to refuse procedure.
Code: Select all
EnableExplicit
Structure tList
List x.l()
EndStructure
Dim ListArray.tList(3)
Define i, j
For i=0 To 3
For j = 1 To 9
AddElement( ListArray(i)\x() )
ListArray(i)\x() = (i+1)*1000 + j
Next j
Next i
For i=0 To 3
ForEach ListArray(i)\x()
Debug ListArray(i)\x()
Next
Debug "-"
Next i
Code: Select all
Procedure procGetPointer( *list )
ProcedureReturn *list
EndProcedure
Prototype.i ptGetPointer( List x.l() )
GetPointer.ptGetPointer = @procGetPointer()
NewList x.l()
For i = 1 To 9
Debug "List pointer: " + Hex(GetPointer( x() ), #PB_Integer)
AddElement( x() )
x() = i
Debug "Element pointer: " + Hex(@x(),#PB_Integer)
Debug "-"
Next
Debug "List pointer: " + Hex(GetPointer( x() ), #PB_Integer)