|
第二部分:
- Private Function m_CanUse(Cell As Integer, Value As Integer) As Boolean
- '
- ' Check whether using value in cell will allow related sub grids to place same value elsewhere
- '
- Dim intRow As Integer
- Dim intCol As Integer
- Dim blnAlternative As Boolean
-
- intRow = m_WhichSubRow(Cell)
- intCol = m_WhichSubCol(Cell)
-
- Select Case intRow
- Case 1
- blnAlternative = m_AlternativeRowAvailable(2, Value)
- blnAlternative = blnAlternative Or m_AlternativeRowAvailable(3, Value)
- Case 2
- blnAlternative = m_AlternativeRowAvailable(1, Value)
- blnAlternative = blnAlternative Or m_AlternativeRowAvailable(3, Value)
- Case 3
- blnAlternative = m_AlternativeRowAvailable(1, Value)
- blnAlternative = blnAlternative Or m_AlternativeRowAvailable(2, Value)
- Case 4
- blnAlternative = m_AlternativeRowAvailable(5, Value)
- blnAlternative = blnAlternative Or m_AlternativeRowAvailable(6, Value)
- Case 5
- blnAlternative = m_AlternativeRowAvailable(4, Value)
- blnAlternative = blnAlternative Or m_AlternativeRowAvailable(6, Value)
- Case 6
- blnAlternative = m_AlternativeRowAvailable(4, Value)
- blnAlternative = blnAlternative Or m_AlternativeRowAvailable(5, Value)
- Case 7
- blnAlternative = m_AlternativeRowAvailable(8, Value)
- blnAlternative = blnAlternative Or m_AlternativeRowAvailable(9, Value)
- Case 8
- blnAlternative = m_AlternativeRowAvailable(7, Value)
- blnAlternative = blnAlternative Or m_AlternativeRowAvailable(9, Value)
- Case 9
- blnAlternative = m_AlternativeRowAvailable(7, Value)
- blnAlternative = blnAlternative Or m_AlternativeRowAvailable(8, Value)
- End Select
-
- Select Case intCol
- Case 1
- blnAlternative = blnAlternative Or m_AlternativeColAvailable(2, Value)
- blnAlternative = blnAlternative Or m_AlternativeColAvailable(3, Value)
- Case 2
- blnAlternative = blnAlternative Or m_AlternativeColAvailable(1, Value)
- blnAlternative = blnAlternative Or m_AlternativeColAvailable(3, Value)
- Case 3
- blnAlternative = blnAlternative Or m_AlternativeColAvailable(1, Value)
- blnAlternative = blnAlternative Or m_AlternativeColAvailable(2, Value)
- Case 4
- blnAlternative = blnAlternative Or m_AlternativeColAvailable(5, Value)
- blnAlternative = blnAlternative Or m_AlternativeColAvailable(6, Value)
- Case 5
- blnAlternative = blnAlternative Or m_AlternativeColAvailable(4, Value)
- blnAlternative = blnAlternative Or m_AlternativeColAvailable(6, Value)
- Case 6
- blnAlternative = blnAlternative Or m_AlternativeColAvailable(4, Value)
- blnAlternative = blnAlternative Or m_AlternativeColAvailable(5, Value)
- Case 7
- blnAlternative = blnAlternative Or m_AlternativeColAvailable(8, Value)
- blnAlternative = blnAlternative Or m_AlternativeColAvailable(9, Value)
- Case 8
- blnAlternative = blnAlternative Or m_AlternativeColAvailable(7, Value)
- blnAlternative = blnAlternative Or m_AlternativeColAvailable(9, Value)
- Case 9
- blnAlternative = blnAlternative Or m_AlternativeColAvailable(7, Value)
- blnAlternative = blnAlternative Or m_AlternativeColAvailable(8, Value)
- End Select
-
- m_CanUse = blnAlternative
-
- End Function
复制代码 |
|