CPoint Class Description CPoint:Ceil

new_point


The new_point function is a non-class version of the CPoint:new method which creates and returns a new CPoint object.

Syntax

P = new_point()

P = new_point( x0 )

P = new_point( x0, y0 )

P = new_point( CPoint_old )

P = new_point( CRect_old )

P = new_point( tbl )

bullet.gif    WIth no parameters, this method creates a CPoint object, assigns x=0 and y=0, and returns the new object.

bullet.gif    x0 is a single number for initializing both the x and y class members.

bullet.gif    y0 is the second number, which initializes the class x and y to x0 and y0.

bullet.gif    CPoint_old is an existing CPoint object.

bullet.gif    CRect_old is an existing CRect object. The class member x is inialized to the rectangle width and y is initialized to the rectangle height.

bullet.gif    tbl is a 1-dimensional array with 2 numeric members at index 1 and index 2. The class x is initialized to tbl[1] and y is initalized to tbl[2].

bullet.gif    P is returned as a new instance of the CPoint class.

bullet.gif    On failure, nil is returned.

Example

The following script creates various CPoint objects.

P = new_point()

-- create a CPoint object

P:Set(4,12)

-- set the values for point members x and y

P1 = new_point(-4,15.2)

-- create a CPoint object with intial values

R = new_rect(1,3,7,12)

-- create a new rectangle object

P3 = P1 + R + 2

-- add the rectangle width and height to P1 and add 2

Related Topics

CPoint class, new, delete


Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.