Page 2 of 2

Posted: Wed Aug 22, 2007 8:59 pm
by Kaeru Gaman
it is almost always useless, because it can't be used with structured lists. :roll:

Posted: Thu Aug 23, 2007 11:04 am
by Trond
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.

Posted: Thu Aug 23, 2007 11:24 am
by ts-soft
Oh, a endless loop, is this a bug :lol:

Posted: Thu Aug 23, 2007 11:26 am
by freak
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.

Posted: Thu Aug 23, 2007 12:16 pm
by Trond

Code: Select all

Procedure FunctionOnTheLeftSide()
  ProcedureReturn 1
EndProcedure

Dim Array(10)
Array(FunctionOnTheLeftSide()) = 1
In pascal you can access the structure members of functions that returns pointers to structures. That's very handy.

Posted: Thu Aug 23, 2007 12:49 pm
by Kaeru Gaman
Trond wrote:

Code: Select all

Dim Array(10)
Array(FunctionOnTheLeftSide()) = 1
I see a problem with your reasoning: this is not a chicken.