Switch to: V9V8V7V6V5

VTable Class: String Fields Creation

Declaration:

CreateStringField( 
	inName as String, 
	inMaxLength as Integer,  
	inFlags as EVFlag = fNone, 
	inMethod as String = "") as VString
 
CreateVarCharField( 
	inName as String, 
	inMaxLength as Integer,  
	inFlags as EVFlag = fNone, 
	inMethod as String = "") as VVarChar

Parameters:

  • inName - The name of the field.
  • inMaxLength - The maximum length ( in characters )
  • inFlags - The flags of the field.
  • inMethod - The text of the method for a calculation field.

Description:

Creates a String or VarChar field.

You need to specify the maximum length in characters. In the case of UTF16 encoding, then 2 bytes per char will be used. If you use a single byte encoding, then one byte per character will be used. You can specify flags for a field to modify its behavior.

You can specify flags for a field to modify its behavior.

If you want to create a calculated field then you should specify the method text.

Example:

fldName = tblPerson.CreateStringField( 
              "fldFirstName", 40, EVFlags.fNullable + EVFlags.fIndexed )

Example:

fldFullName = tblPerson.CreateVarCharField( 
               "fldFulleName", 40, EVFlags.fNullable + EVFlags.fIndexed,
               "concat( fldFirstName, ' ', fldLastName)" )