AddElement(List()) = "Value"
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
But it CAN.
Code: Select all
; Suggestion
AddElement(StructuredList())\Field1 = Value1
StructuredList()\Field2 = Value2
; Current
AddElement(StructuredList())
StructuredList()\Field1 = Value1
StructuredList()\Field2 = Value2
; Suggestion saves 1 line per added item for structured lists.
; Suggestion
AddElement(List()) = Value
; Current
AddElement(List())
List() = Value
; Suggestion saves 1 line per added item for unstructured list
; Since it saves the same amount of lines per added item for both
; unstructred and structured lists it is just as useful for structured lists.
Oh, a endless loop, is this a bug 

PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

AddElement() is a regular Function.
You cannot have a function on the left hand side of an assignment,
and changing this just for this special case does not make much sense imho.
You cannot have a function on the left hand side of an assignment,
and changing this just for this special case does not make much sense imho.
Last edited by freak on Thu Aug 23, 2007 12:29 pm, edited 1 time in total.
quidquid Latine dictum sit altum videtur
Code: Select all
Procedure FunctionOnTheLeftSide()
ProcedureReturn 1
EndProcedure
Dim Array(10)
Array(FunctionOnTheLeftSide()) = 1
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
I see a problem with your reasoning: this is not a chicken.Trond wrote:Code: Select all
Dim Array(10) Array(FunctionOnTheLeftSide()) = 1
oh... and have a nice day.