Move the position of the record.
@exception DBException File exception.
@iRelPosition Number of positions to move.
@return The record.
174922
public FieldList move(int iRelPosition) throws DBException
    {
        this.setCurrentRecord(this.getBaseRecord());
        boolean bAfterRequery = !this.getBaseRecord().isOpen();
        if (!this.isOpen())
            this.open();    // Make sure any listeners are called before disabling.
        Object[] rgobjEnabledFields = this.getBaseRecord().setEnableNonFilter(null, false, false, false, false, true);
        try {
            Record record = (Record)super.move(iRelPosition);
            if (record == null)
                return null;

            this.getBaseRecord().setEnableNonFilter(rgobjEnabledFields, true, false, bAfterRequery, false, true);
            rgobjEnabledFields = null;
            
      //      this.getBaseRecord().handleValidRecord(); // Display Fields (handleValidRecord this was done in setEnableNonFilter)
            record = this.moveToCurrentRecord(record);
            if (record != null) if (record != this.getBaseRecord())
                record.handleValidRecord(); // Display Fields

            return record;
        } catch (DBException ex)    {
            throw ex;
        } finally {
            if (rgobjEnabledFields != null)
                this.getBaseRecord().setEnableNonFilter(rgobjEnabledFields, false, false, bAfterRequery, true, true);   // EOF
        }
    }
671822
public void open() throws DBException
    {
        // Ignore open - wait for move(+1);
        // 1. Synchronize selection:
        Record record = this.getRecord();
        Iterator<BaseTable> iterator = this.getTables();
        while (iterator.hasNext())
        {
            BaseTable table = iterator.next();
            Record recAlt = table.getRecord();
            if (record.isAllSelected())
                recAlt.setSelected(true);
            else
            {
                recAlt.setSelected(false);
                for (int iFieldSeq = 0; iFieldSeq < record.getFieldCount(); iFieldSeq++)
                {
                    if (record.getField(iFieldSeq).isSelected())
                        recAlt.getField(iFieldSeq).setSelected(true);
                }
            }
        }
        this.doOpen();      // Set isOpen flag to true.
    }
219541
public void doSet(Rec record) throws DBException
    {
        super.doSet(record);
        if (m_arrayCache != null)
            if (m_iLogicalIndex != NO_INDEX)
            {
                m_arrayCache.set(m_iLogicalIndex, this.getDataSource());    // Show the current record as deleted.
            }
    }
521625
public int doMove(int iRelPosition) throws DBException
    {
        try   {
            BaseBuffer buffer = m_pTable.move(iRelPosition, this);
            this.doSetHandle(buffer, DBConstants.DATA_SOURCE_HANDLE);
            int iRecordStatus = DBConstants.RECORD_NORMAL;
            if (buffer == null) if ((iRelPosition < 0) || (iRelPosition == DBConstants.LAST_RECORD))
                iRecordStatus |= DBConstants.RECORD_AT_BOF;
            if (buffer == null) if ((iRelPosition >= 0) || (iRelPosition == DBConstants.FIRST_RECORD))
                iRecordStatus |= DBConstants.RECORD_AT_EOF;
            return iRecordStatus;
        } catch (DBException ex)    {
            throw DatabaseException.toDatabaseException(ex);
        }
    }
658274
public int moveControlInput(String strSuffix)
        throws DBException
    {
        int iDefaultParamsFound = DBConstants.NO_PARAMS_FOUND;
        if (!(this.getScreenField() instanceof BasePanel))
        {   // Regular input field
            if (this.getScreenField().isInputField())
            {
                String strFieldName = this.getScreenField().getSFieldParam(strSuffix);
                String strParamValue = this.getSFieldProperty(strFieldName);

                if (strParamValue != null)
                {
                    int iErrorCode = this.getScreenField().setSFieldValue(strParamValue, DBConstants.DONT_DISPLAY, DBConstants.SCREEN_MOVE);
                    if (iErrorCode != DBConstants.NORMAL_RETURN)
                    {
                        DatabaseException ex = new DatabaseException(iErrorCode);
                        String strError = ex.getMessage(this.getScreenField().getParentScreen().getTask());
                        String strFieldDesc = null;
                        if (this.getScreenField().getConverter() != null)
                            strFieldDesc = this.getScreenField().getConverter().getFieldDesc();
                        if ((strFieldDesc == null) || (strFieldDesc.length() == 0))
                            strFieldDesc = strFieldName;
                        if (strError != null) // Add the field name to the error
                            ex = new DatabaseException(strError + " on " + strFieldDesc + " field");
                        throw ex;
                    }
                    iDefaultParamsFound = DBConstants.NORMAL_RETURN;
                }
            }      
        }
        else
        {   
            int iNumCols = ((BasePanel)this.getScreenField()).getSFieldCount();
            String strMoveValue = this.getProperty(DBParams.COMMAND);      // Display record
            if (strMoveValue == null)
                strMoveValue = Constants.BLANK;
            if ((strMoveValue != null) && (strMoveValue.length() > 0))    // Only move params on submit
            {  // Move the input params to the record fields
                for (int iIndex = 0; iIndex < iNumCols; iIndex++)
                {
                    ScreenFieldView vField = ((BasePanel)this.getScreenField()).getSField(iIndex).getScreenFieldView();
                    if (vField.moveControlInput(strSuffix) == DBConstants.NORMAL_RETURN)
                        iDefaultParamsFound = DBConstants.NORMAL_RETURN;
                }
            }
        }
        return iDefaultParamsFound;
    }
558286
public void remove() throws DBException
    {
        super.remove();
        Iterator<BaseTable> iterator = this.getTables();
        while (iterator.hasNext())
        {
            BaseTable table = iterator.next();
            if ((table != null) && (table != this.getNextTable()))
            {
                if ((table.getRecord().getEditMode() == Constants.EDIT_IN_PROGRESS) || (table.getRecord().getEditMode() == Constants.EDIT_CURRENT))
                    table.remove();
            }
        }
    }
362260
public int doMove(int iRelPosition) throws DBException
    {
        int iRecordStatus = super.doMove(iRelPosition);
        if ((iRecordStatus == Constants.NORMAL_RETURN)
            || (iRecordStatus == FieldTable.DELETED_RECORD.intValue()))   // Deleted record
        {
            if (m_arrayCache != null)
                if (m_iPhysicalIndex != NO_INDEX)
            {
                m_iPhysicalIndex = m_iPhysicalIndex + iRelPosition;
                Object data = null;
                if (iRecordStatus == Constants.NORMAL_RETURN)
                    data = this.getDataSource();
                m_arrayCache.set(m_iPhysicalIndex, data); // Update the current record.
            }
        }
        else
        {
            if (iRelPosition > 0)
            {
                m_iEndOfFileIndex = m_iPhysicalIndex;
                m_iPhysicalIndex = NO_INDEX;
            }
            else
                if (m_arrayCache != null)
                    if (m_iPhysicalIndex != NO_INDEX)
                        m_arrayCache.set(m_iPhysicalIndex, null); // Show the current record as deleted.
        }
        return iRecordStatus;
    }
1152327
public Object[] nextRecord() {
        try {
            int nextByte;
            do {
                nextByte = dataInput.readByte();
                if (nextByte == DATA_ENDED) {
                    return null;
                } else if (nextByte == DATA_DELETED) {
                    dataInput.skipBytes(header.getRecordLength() - 1);
                }
            } while (nextByte == DATA_DELETED);

            Object recordObjects[] = new Object[header.getFieldsCount()];
            for (int i = 0; i < header.getFieldsCount(); i++) {
                recordObjects[i] = readFieldValue(header.getField(i));
            }
            return recordObjects;
        } catch (EOFException e) {
            return null; // we currently end reading file
        } catch (IOException e) {
            throw new DbfException("Cannot read next record form Dbf file", e);
        }
    }
750356
public void doSet(Record record) throws DBException
    {
        try   {
            m_pTable.set(this);
        } catch (DBException ex)    {
            throw DatabaseException.toDatabaseException(ex);
        }
    }
1350266
@Override
    protected boolean moveCursor() throws SQLException, OntopConnectionException {
        boolean foundFreshRow;
        List<Object> currentKey;
        do{
           foundFreshRow = rs.next();
           // Cannot use this in the while condition: limit case where the last row was a duplicate
           if(!foundFreshRow) {
               break;
           }
           currentKey = computeRowKey(rs);
        } while(!rowKeys.add(currentKey));

        return foundFreshRow;
    }
1284795
public FileIndexBuilder setStartingRecordPosition(long recordPosition) {
        checkIfDestroyed();
        if (index.size() != 1)
            throw new IllegalStateException("Initial record is already initialised to " + index.get(0));
        index.set(0, startingByte = recordPosition);
        return this;
    }
372386
public void doRemove() throws DBException
    {
        super.doRemove();
        if (m_arrayCache != null)
            if (m_iLogicalIndex != -1)
                m_arrayCache.set(m_iLogicalIndex, null);    // Show the current record as deleted.
    }
382511
@Override
    public boolean next() throws SQLException {
        checkClosed();
        if (cursorPosition == Position.afterLast || table.getActiveRowIndex() == rowCount - 1) {
            cursorPosition = Position.afterLast;
            return false;
        }
        if (cursorPosition == Position.beforeFirst) {
            cursorPosition = Position.middle;
        }
        try {
            return table.advanceRow();
        } catch (Exception x) {
            throw SQLError.get(x);
        }
    }
714508
public int moveFieldToThis(BaseField field, boolean bDisplayOption, int iMoveMode)
    {   // Save the record and datarecord.
        if (field == null)
            return DBConstants.NORMAL_RETURN;
        if (field instanceof CounterField)
        {
            if (this.getReferenceRecord(null, false) == null)
                if (field.getRecord().getListener(ClearFieldReferenceOnCloseHandler.class) == null) // While it is okay to have two fields reference on record, don't default it.
                    this.setReferenceRecord(field.getRecord());
        }
        else if (field instanceof ReferenceField)
        {
//x no           this.setReferenceRecord(((ReferenceField)field).getReferenceRecord());
        }
        else
            this.setReferenceRecord(null);
        return super.moveFieldToThis(field, bDisplayOption, iMoveMode);
    }
368720
public void fieldsToData(Rec record) throws DBException
    {
        try   {
            int iFieldTypes = BaseBuffer.PHYSICAL_FIELDS;
            if (!((Record)record).isAllSelected())
                iFieldTypes = BaseBuffer.DATA_FIELDS;   //SELECTED_FIELDS; (Selected and physical)
            m_dataSource = new VectorBuffer(null, iFieldTypes);   //x new StringBuff();
            ((BaseBuffer)m_dataSource).fieldsToBuffer((FieldList)record);
        } catch (Exception ex) {
            throw DatabaseException.toDatabaseException(ex);
        }
    }
1024925
public void remove() throws DBException
    {
        this.syncCurrentToBase();
        boolean[] rgbListenerState = this.getRecord().setEnableListeners(false);
        this.getRecord().handleRecordChange(DBConstants.DELETE_TYPE);   // Fake the call for the grid table
        this.getRecord().setEnableListeners(rgbListenerState);
        
        super.remove();
        this.syncCurrentToBase();

        rgbListenerState = this.getRecord().setEnableListeners(false);
        this.getRecord().handleRecordChange(DBConstants.AFTER_DELETE_TYPE);   // Fake the call for the grid table
        this.getRecord().setEnableListeners(rgbListenerState);
    }
1155009
public void open() throws DBException
    {
        super.open();
        this.getRecord().setEditMode(DBConstants.EDIT_NONE);    // Being careful
        Iterator<BaseTable> iterator = this.getTables();
        while (iterator.hasNext())
        {
            BaseTable table = iterator.next();
            if ((table != null) && (table != this.getNextTable()))
            {
                this.syncRecordToBase(table.getRecord(), this.getRecord(), true); // Note: I am syncing the base to the alt here
                table.open();
            }
        }
    }