📄 modutil.bas
字号:
Attribute VB_Name = "ModUtil"
' This sample application and corresponding sample code is provided
' for example purposes only. It has not undergone rigorous testing
' and as such should not be shipped as part of a final application
' without extensive testing on the part of the organization releasing
' the end-user product.
Option Explicit
' Return true if the layer is permanent. We do this by seeing if the layer has a
' .tab extension. If it's a temporary layer, it'll have a ".tmp" extension.
Public Function IsPermanent(lyr As Layer) As Boolean
If LCase$(Right$(lyr.Filespec, 3)) = "tab" Then
IsPermanent = True
Else
IsPermanent = False
End If
End Function
' Returns true if the object is invalid in some way. Returns false otherwise
Public Function IsInvalidObject(Obj As Variant) As Boolean
If IsNull(Obj) = True Or IsEmpty(Obj) = True Or TypeName(Obj) = "Nothing" Then
IsInvalidObject = True
Else
IsInvalidObject = False
End If
End Function
' Returns true if lyr is the current insertion layer
Public Function IsInsertionLayer(lyr As Layer) As Boolean
If IsInvalidObject(FrmMain.Map1.Layers.InsertionLayer) Then
IsInsertionLayer = False
ElseIf lyr = FrmMain.Map1.Layers.InsertionLayer Then
IsInsertionLayer = True
Else
IsInsertionLayer = False
End If
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -