def changeRecords( fieldNameToSet, fieldValueToSet, fieldNameToTest, test, fieldValueToTest )

      if @dbid and @fields and fieldNameToSet and fieldValueToSet and fieldNameToTest and test and fieldValueToTest

         numRecsChanged = 0
         numRecs = _getNumRecords

         if numRecs > "0"

            fieldType = "text"
            if fieldNameToTest
               fieldNameToTestID = lookupFieldIDByName( fieldNameToTest )
               field = lookupField( fieldNameToTestID ) if fieldNameToTestID
               fieldType = field.attributes[ "field_type" ] if field
            end

            fieldNameToSetID = lookupFieldIDByName( fieldNameToSet )

            if fieldNameToSetID
               clearFieldValuePairList
               addFieldValuePair( nil, fieldNameToSetID, nil, fieldValueToSet )
               (1..numRecs.to_i).each{ |rid|
                  _getRecordInfo( rid.to_s )
                  if @num_fields and @update_id and @field_data_list
                     if fieldNameToTestID and test and fieldValueToTest
                        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
                              editRecord( @dbid, rid.to_s, @fvlist )
                              if @rid
                                 numRecsChanged += 1
                              end
                           end
                        end
                     else
                        editRecord( @dbid, rid.to_s, @fvlist )
                        if @rid
                           numRecsChanged += 1
                        end
                     end
                  end
               }
            end
         end
      end
      numRecsChanged
   end
def changeRecords( fieldNameToSet, fieldValueToSet, fieldNameToTest, test, fieldValueToTest )

      if @dbid and @fields and fieldNameToSet and fieldValueToSet and fieldNameToTest and test and fieldValueToTest

         numRecsChanged = 0
         numRecs = _getNumRecords

         if numRecs > "0"

            fieldType = "text"
            if fieldNameToTest
               fieldNameToTestID = lookupFieldIDByName( fieldNameToTest )
               field = lookupField( fieldNameToTestID ) if fieldNameToTestID
               fieldType = field.attributes[ "field_type" ] if field
            end

            fieldNameToSetID = lookupFieldIDByName( fieldNameToSet )

            if fieldNameToSetID
               clearFieldValuePairList
               addFieldValuePair( nil, fieldNameToSetID, nil, fieldValueToSet )
               (1..numRecs.to_i).each{ |rid|
                  _getRecordInfo( rid.to_s )
                  if @num_fields and @update_id and @field_data_list
                     if fieldNameToTestID and test and fieldValueToTest
                        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
                              editRecord( @dbid, rid.to_s, @fvlist )
                              if @rid
                                 numRecsChanged += 1
                              end
                           end
                        end
                     else
                        editRecord( @dbid, rid.to_s, @fvlist )
                        if @rid
                           numRecsChanged += 1
                        end
                     end
                  end
               }
            end
         end
      end
      numRecsChanged
   end
Change a field's value in multiple records.  If the optional test
 field/operator/value are supplied, only records matching the test field will be
 modified, otherwise all records will be modified.
 e.g. changeRecords( "Status", "special", "Account Balance", ">", "100000.00" )