News:

Building a 3D Ray Tracer  By stevmjon

Main Menu

Access nested passed type?

Started by lime_spring, May 15, 2013, 08:16:11 PM

Previous topic - Next topic

lime_spring

Am I doing something wrong or is this not supported?

PlayBASIC Code: [Select]
  Type Pos
x,y
EndType

Type MyObject
Dot1 As Pos
Dot2 As Pos
EndType

Dim Item As MyObject

Item= New MyObject

PlaceDot1(Item, 100,200)

Function PlaceDot1(me As MyObject Pointer,x,y)
me.Dot1.x=x
me.Dot1.y=y
EndFunction



It gives me Expecting Generic Pointer Data Type

kevin

QuoteAm I doing something wrong or is this not supported?

   Yep,  you're attempt to pass the type handle into a type pointer

PlayBASIC Code: [Select]
Type Pos
x,y
EndType

Type MyObject
Dot1 As Pos
Dot2 As Pos
EndType

Dim Item As MyObject

Item= New MyObject

PlaceDot1(Item, 100,200)

Function PlaceDot1(me As MyObject,x,y)
me.Dot1.x=x
me.Dot1.y=y
EndFunction



 

lime_spring