def deleteRecords( fieldNameToTest = nil, test = nil, fieldValueToTest = nil)
      numRecsDeleted = 0
      if @dbid and @fields and fieldNameToTest and test and fieldValueToTest

         numRecs = _getNumRecords

         if numRecs > "0"

            fieldNameToTestID = lookupFieldIDByName( fieldNameToTest )
            fieldToTest = lookupField( fieldNameToTestID ) if fieldNameToTestID
            fieldType = fieldToTest.attributes[ "field_type" ] if fieldToTest

            if fieldNameToTestID
               (1..numRecs.to_i).each{ |rid|
                  _getRecordInfo( rid.to_s )
                  if @num_fields and @update_id and @field_data_list
                     field_data = lookupFieldData( fieldNameToTestID )
                     if field_data and field_data.is_a?( REXML::Element )
                        valueElement = field_data.elements[ "value" ]
                        value = valueElement.text if valueElement.has_text?
                        value = formatFieldValue( value, fieldType )
                        match = eval( "\"#{value}\" #{test} \"#{fieldValueToTest}\"" ) if value
                        if match
                           if _deleteRecord( rid.to_s )
                              numRecsDeleted += 1
                           end
                        end
                     end
                  end
               }
            end
         end
      elsif @dbid
         numRecsDeleted = _purgeRecords
      end
      numRecsDeleted
   end
def deleteRecords( fieldNameToTest = nil, test = nil, fieldValueToTest = nil)
      numRecsDeleted = 0
      if @dbid and @fields and fieldNameToTest and test and fieldValueToTest

         numRecs = _getNumRecords

         if numRecs > "0"

            fieldNameToTestID = lookupFieldIDByName( fieldNameToTest )
            fieldToTest = lookupField( fieldNameToTestID ) if fieldNameToTestID
            fieldType = fieldToTest.attributes[ "field_type" ] if fieldToTest

            if fieldNameToTestID
               (1..numRecs.to_i).each{ |rid|
                  _getRecordInfo( rid.to_s )
                  if @num_fields and @update_id and @field_data_list
                     field_data = lookupFieldData( fieldNameToTestID )
                     if field_data and field_data.is_a?( REXML::Element )
                        valueElement = field_data.elements[ "value" ]
                        value = valueElement.text if valueElement.has_text?
                        value = formatFieldValue( value, fieldType )
                        match = eval( "\"#{value}\" #{test} \"#{fieldValueToTest}\"" ) if value
                        if match
                           if _deleteRecord( rid.to_s )
                              numRecsDeleted += 1
                           end
                        end
                     end
                  end
               }
            end
         end
      elsif @dbid
         numRecsDeleted = _purgeRecords
      end
      numRecsDeleted
   end
Delete all records in the active table that match
 the field/operator/value. e.g. deleteRecords( "Status", "==", "inactive" ).
 To delete ALL records, call deleteRecords() with no parameters. This is the
 same as calling _purgeRecords.