- 积分
- 564
- 明经币
- 个
- 注册时间
- 2007-9-17
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
1明经币
以下是我学习VBA时遇到的一段程序,但不明白为什么要加入“Retry:”,有什么好处吗?另外“Retry:”这一类东东是叫行标签吗?谢谢。
Public Sub ZoomScale()
Dim strInput As String
Dim scaleZoom As Double
Retry:
strInput = ThisDrawing.Utility.GetString(False, "输入缩入比例:")
Dim zoomType As Integer '缩入比例的类例
If StrComp(Right$(strInput, 1), "x", vbTextCompare) <> 0 And StrComp(Right$(strInput, 2), "xp", vbTextCompare) <> 0 Then
zoomType = 0
scaleZoom = CDbl(strInput)
ElseIf StrComp(Right$(strInput, 1), "x", vbTextCompare) = 0 Then
zoomType = 1
scaleZoom = CDbl(Left$(strInput, Len(strInput) - 1))
ElseIf StrComp(Right$(strInput, 2), "xp", vbTextCompare) = 0 Then
zoomType = 2
scaleZoom = CDbl(Left$(strInput, Len(strInput) - 2))
End If
ThisDrawing.Application.ZoomScaled scaleZoom, zoomType
End Sub
|
|