How to pass a structured variable to a function
Posted: Fri Nov 19, 2004 1:40 am
				
				Could someone please advise me on how to pass a structured variable to a function. It would seem that a structure can not be passed to a function directly. The documentation states that it cannot be passed to a procedure directly, unless I misunderstood. Most likely by a pointer?? I have tried several different ways which did not work. 
Thanks
Ken
[/code]
*iError.w = 0
Structure Point2D
x.double
y.double
EndStructure
Dim StartLine.Point2D(1)
Dim EndLine.Point2D(1)
F64_Val(StartLine(0)\x,"0")
F64_Val(StartLine(0)\y,"0")
F64_Val(EndLine(0)\x,"100")
F64_Val(Endline(0)\y,"0")
  
;OpenConsole()
;PrintN(F64_Str(StartLine(0)\x, 15,#F64_Format_Decimal))
;PrintN(F64_Str(StartLine(0)\y, 15,#F64_Format_Decimal))
;PrintN(F64_Str(EndLine(0)\x, 15,#F64_Format_Decimal))
;PrintN(F64_Str(EndLine(0)\y, 15,#F64_Format_Decimal))
;Input()
;CloseConsole()
;How do I pass a structured type variable such as StartLine and Endline to
;the Function VCAddLineEntity.
OpenLibrary (0,"vcmain32.dll")
CallFunction (0,"VCAddLineEntity",@*iError,-1,StartLine,Endline)
CloseLibrary(0)
			Thanks
Ken
[/code]
*iError.w = 0
Structure Point2D
x.double
y.double
EndStructure
Dim StartLine.Point2D(1)
Dim EndLine.Point2D(1)
F64_Val(StartLine(0)\x,"0")
F64_Val(StartLine(0)\y,"0")
F64_Val(EndLine(0)\x,"100")
F64_Val(Endline(0)\y,"0")
;OpenConsole()
;PrintN(F64_Str(StartLine(0)\x, 15,#F64_Format_Decimal))
;PrintN(F64_Str(StartLine(0)\y, 15,#F64_Format_Decimal))
;PrintN(F64_Str(EndLine(0)\x, 15,#F64_Format_Decimal))
;PrintN(F64_Str(EndLine(0)\y, 15,#F64_Format_Decimal))
;Input()
;CloseConsole()
;How do I pass a structured type variable such as StartLine and Endline to
;the Function VCAddLineEntity.
OpenLibrary (0,"vcmain32.dll")
CallFunction (0,"VCAddLineEntity",@*iError,-1,StartLine,Endline)
CloseLibrary(0)