If (fdtnlayer>0 .And. fdtnlayer<nlayer) Then
iBegin = nLayer
iEnd = fdtnLayer
iStep = -1
Else If (fdtnlayer==nlayer) Then
iBegin = 1
iEnd = 0 !// 结束小于开始,则不循环
iStep = 1
Else If (tdtnlayer>0 .And. tdtnlayer<nlayer) Then
iBegin = tdtnLayer
iEnd = 1
iStep = -1
Else If (tdtnlayer==nlayer) Then
iBegin = nLayer
iEnd = 1
iStep = -1
End If
Do i = iBegin , iEnd , iStep
...
End Do