Switch to: V9V8V7V6V5

VTable Class: Numeric Fields Creation

VTable class has a set of methods to create fields of numeric types. They all are very similar, so we provide here template of such function description using ($Type) as parameter of template, which can get the following values:

$Type = { Boolean, Byte, Short, UShort, Medium, UMedium, Long, ULong, LLong, ULLong, Date, Time, DateTime }

VTable.Create($Type)Field()

Declaration:

Create($Type)Field( 
  inName as string, inFlags as EVFlag = fNone, inMethod as String = "" ) as VShort

Parameters:

  • inName - The name of the field.
  • inFlags - The flags of the field.
  • inMethod - The text of the method for a calculation field.

Description:

Creates a numeric field of ($Type) type.

To create a numeric field:

  • You should specify its name. The name must be unique in the scope of this table.
  • You can specify flags for a field to modify its behavior.
  • If you want to create a calculation field (i.e. Table Method) then you should specify text of calculation using the inMethod parameter.

Example:

dim fldShort as VShort
 
fldShort = tblPerson.CreateShortField( 
			"fldShort",  EVFlags.fNullable + EVFlags.fIndexed )

Example:

Creation of Table Method:

dim f2, m2 as VLong
 
f2 = tblPerson.CreateLongField( 
			"f2",  EVFlags.fNullable + EVFlags.fIndexed )
 
m2 = tblPerson.CreateLongField( 
			"fm2",  EVFlags.fNullable + EVFlags.fIndexed, "f2 + 100" )