Howdy All,
I'm trying to port some code from AcrionScript3. The code uses the "New" operator. I believe it is similar to "New" in VB6. Any ideas on how to achieve the same thing with B4A?
Below is part of the code I am porting. The function cloneVector is suppose to clone the very object that is associated with the class that this function is in.
Any thoughts would be appreciated.
I'm trying to port some code from AcrionScript3. The code uses the "New" operator. I believe it is similar to "New" in VB6. Any ideas on how to achieve the same thing with B4A?
Below is part of the code I am porting. The function cloneVector is suppose to clone the very object that is associated with the class that this function is in.
B4X:
public class Vector2D {
private var _x:Number;
private var _y:Number;
/**
* Constructor
*/
public function Vector2D(x:Number = 0, y:Number = 0) {
_x = x;
_y = y;
}
/**
* Creates an exact copy of this Vector2D
* @return Vector2D A copy of this Vector2D
*/
public function cloneVector():Vector2D {
return new Vector2D(x, y);
}
Any thoughts would be appreciated.