-3

コンパイル中にエラーが発生します。byref 引数の型の不一致プロンプト。「setStandard s2.day(dCnt)」部分が強調表示されます。それを解決する方法がわかりません。dCnt、wCnt、tCnt、および wCnt はすべて整数として宣言されます。

Private Sub S2_Sort()
    Dim x As Integer, t As Integer
    x = 0
    t = tCnt
    'loop record
    Do While x < t
        'loop day
        For dCnt = 1 To UBound(S2.Day())

            'inpDate = S2.Day(dCnt).DayVal
            ReDim S2.Day(dCnt).tList(0)

            'If DateValue(S2.Day(dCnt).DayVal) = DateValue(DataRecord(x).StartTime) Then

            'loop shift
                For tCnt = 1 To UBound(TaskID())

                    ReDim Preserve S2.Day(dCnt).tList(tCnt)
                    ReDim Preserve S2.Day(dCnt).tList(tCnt).sList(0)

                    dicShift.RemoveAll
                    'If x <= UBound(DataRecord()) Then
                        'If GetTimestamp(S2.Day(dCnt).DayVal, Shift(sCnt).StartHour, Shift(sCnt).HourLen, Shift(sCnt).NextDay, DataRecord(x)) Then
                            'loop task
                            For sCnt = 1 To UBound(Shift())

                                ReDim Preserve S2.Day(dCnt).tList(tCnt).sList(sCnt)
                                ReDim Preserve S2.Day(dCnt).tList(tCnt).sList(sCnt).TaskRecList(0)

                                wCnt = 0
                                'Do While x <= UBound(DataRecord())
                                    ReDim Preserve S2.Day(dCnt).tList(tCnt).sList(sCnt).TaskRecList(wCnt)
                                    ''state here all the conditions
                                    If x <= UBound(DataRecord()) Then
                                        If GetTimestamp(S2.Day(dCnt).DayVal, Shift(sCnt).StartHour, Shift(sCnt).HourLen, Shift(sCnt).NextDay, DataRecord(x)) Then
                                            If DataRecord(x).TaskID = TaskID(tCnt).TaskID Then
                                                'should contain the tasks
                                                dicDay.RemoveAll

                                                'get the work time number and list it on stLIst
                                                'S2.Day(dCnt).sList(sCnt).ShiftName = ""
                                                'S2.Day(dCnt).sList(sCnt).tList(tCnt).ResourceName = ""
                                                S2.Day(dCnt).tList(tCnt).sList(sCnt).TaskRecList(wCnt) = x

                                                'Compute for task, for the shift, for the day
                                                'compute pataas
                                                S2.Day(dCnt).tList(tCnt).sList(sCnt).Val = S2_Compute(x, S2.Day(dCnt).tList(tCnt).sList(sCnt).Val)
                                                S2.Day(dCnt).tList(tCnt).Val = S2_Compute(x, S2.Day(dCnt).tList(tCnt).Val)
                                                S2.Day(dCnt).tList(tCnt).MstUnit = DataRecord(x).MeasurementUnit
                                                S2.Day(dCnt).tList(tCnt).Cost = DataRecord(x).Cost
                                                S2.Day(dCnt).tList(tCnt).ResourceName = S2.Day(dCnt).tList(tCnt).ResourceName + DataRecord(x).ResourceName
                                                S2.Day(dCnt).Val = S2_Compute(x, S2.Day(dCnt).Val)

                                                x = x + 1
                                                wCnt = wCnt + 1
                                            End If
                                        End If
                                    End If
                                'Loop 'task record
                            Next sCnt 'Next Shift
                        'End If 'shift
                    'End If 'x <datarecord
                Next tCnt 'Next Task
            'End If 'day
            setStandard S2.Day(dCnt).Val
        Next dCnt 'Next Day
    Loop
End Sub
4

1 に答える 1