new Method

Class:  Class

Description

This method defines a new object in create mode. Use the Db.getRecord method to create a new object in modify mode.

Syntax

Class.new(String className,String initInstance)

Parameters

className

A valid class name.

initInstance

A string passed to the class constructor subroutine. It can be used to initialize properties of the instance (e.g., access keys for the new Record class option) (Optional)

Returns

An object name.

When Became Available

v6.0

Example 1 - pre-Profile v6.4

type RecordLNCPN lncpn = Class.new("RecordLNCPN")

set lncpn.pnd = TJD // Access key 1

set lncpn.pmet = 3 // Access key 2

set lncpn.cid = CID // Access key 3

do lncpn.bypassSave() // File data

Example 2 - Profile v6.4 and later versions

set BRCD = Db.nextVal(“UTBLBRCD”) //highest key value + 1

type RecordUTBLBRCD utblbrcd = Class.new("RecordUTBLBRCD","BRCD")

set utblbrcd.desc     = "New Branch"

set utblbrcd.brcity   = "San Francisco"

set utblbrcd.brstate  = "California"

do utblbrcd.save()