Switch to: V9V8V7V6V5

VTable Class: Record Methods

VTable.SetBlank()

Declaration:

SetBlank( inAccess as EvValueAccess = forUpdate )

Parameters:

  • inAccess - Specify if you do SetBlank for add or for update of a record.

Description:

Each VTable has a memory buffer in RAM for field values of the current record. This buffer can be cleared by the SetBlank() method, i.e. all numeric fields become zero, all string fields get an empty string. If any fields are nullable then they get a NULL value.

Parameter inAccess can be used to speed up SetBlank() if you add records. In this case you can specify its value forAdd, so Valentina will not save copies of previous field values. In the same time you can always use the default value forUpdate and everyhting will work correctly.

Example:

Table.SetBlank()

VTable.AddRecord()

Declaration:

AddRecord() as Integer

Description:

Adds a new record to the table with the current values in the memory buffer of this Table.

Returns the RecID of the new record.

Note: You should assign values to the fields for the new record, then call AddRecord().

Example:

thePerson.SetBlank
thePerson.FirstName.Value = “John” 
thePerson.LastName.Value = “Roberts” 
NewRecID = thePerson.AddRecord()

VTable.DeleteRecord()

Declaration:

DeleteRecord()

Description:

Deletes the current record of a Table.

After deletion, the next record becomes the current one if it exists. Otherwise the previous record becomes current. If a Cursor becomes empty then the current record will be undefined.

Example:

Table.DeleteRecord()

VTable.DeleteAllRecords()

Declaration:

DeleteAllRecords( inSet as VSet = nil )

Parameters:

  • inSet - The selection of records.

Description:

Deletes all records in a Table if inSet is nil. Otherwise deletes only the specified selection of records.

Example:

Table.DeleteAllRecords()

VTable.UpdateRecord()

Description:

UpdateRecord()

Description:

This method stores new modified values of fields of the current record of the Table.

Example:

thePerson.RecID = SomeRecID 
thePerson.FirstName.Value = “Brian” 
thePerson.LastName.Value = “Blood” 
thePerson.UpdateRecord()

VTable.UpdateAllRecords()

Declaration:

UpdateAllRecords( inSet as VSet = nil )

Parameters:

  • inSet - The selection of records.

Description:

Updates all records in a Table if inSet is nil. Otherwise updates only the specified selection of records.

Example:

Table.UpdateAllRecords()