NewPoint
The NewPoint function returns a new CPoint object. This function is a global form of the CPoint:new method. The CPoint class includes x and y properties. You can use this object as a coordinate point or simply as a pair of numbers that are processed together.
P = NewPoint() P = NewPoint( CPointOld ) P = NewPoint( x, y ) P = NewPoint( x ) P = NewPoint( CPoint ) P = NewPoint( CRect ) P = NewPoint( array ) where
|
Since this function returns a new CPoint object, it is useful in expressions like I:Setn(NewPoint(t)).
The following script illustrates using various forms of NewPoint. All produce the same result:
|
|
|
-- create CPoint A and set values |
|
-- result: 100 300 |
|
|
|
-- copy CPoint A to a new CPoint B |
|
-- result: 100 300 |
|
|
|
-- create a default CPoint C |
|
|
|
-- result: 100 300 |