DeleteSet()

Summary

Deletes a set from the current view.

Syntax

DeleteSet(string set_name)

Argument Contents
set_name The name of the set to be deleted. The set must belong to the current view.

Notes

  • The set is deleted, regardless of whether the set contains any records.

  • Under no circumstances are the records themselves deleted.

  • DeleteSet() fails if a set is currently in use (e.g., if the records in a set are displayed in an editor).

Example

folder = RunMacro("G30 Tutorial Folder")
CopyFile(folder + "manheats.dbf", folder + "manheats2.dbf")
view = OpenTable("manheats", "DBASE", {folder + "manheats2.dbf"}, {{"Shared", "True"}})
SetView(view)
american = CreateSet("American")
n = SelectByQuery(american, "Several", "Select * where CUISINE = 'AMERICAN'")
if n > 0 then DeleteRecordsInSet(american)
if n > 0 then do
ShowMessage("Yes, there are some American restaurants!")
DeleteSet(american)
end

Error Codes

Error Type Meaning
Error The set is in use, or there is no current view.
NotFound The named set does not exist.

See Also

Function Summary
CreateSet() Creates a new, empty set on the current view
DeleteRecordsInSet() Deletes all of the records in a selection set from a view