home *** CD-ROM | disk | FTP | other *** search
- Attribute VB_Name = "modProperties"
- '******************************************************************'
- '* *'
- '* TurboCAD for Windows *'
- '* Copyright (c) 1993 - 2001 *'
- '* International Microcomputer Software, Inc. *'
- '* (IMSI) *'
- '* All rights reserved. *'
- '* *'
- '******************************************************************'
-
- Option Explicit
-
- Public Function PropertyFlagsAsString(ByVal prop As Property)
- On Error Resume Next
- Dim s As String
- s = ""
- If prop.IsAttribute Then s = s & "Attr "
- If prop.ReadOnly Then s = s & "RO "
- PropertyFlagsAsString = s
- End Function
-
- Public Function PropertyTypeAsString(ByVal prop As Property)
- On Error Resume Next
- Dim s, s2 As String
- Dim t As Integer
- t = 0
- t = prop.Type
- If (t And vbArray) <> 0 Then
- t = t And 8191
- s2 = "()"
- Else
- s2 = ""
- End If
- Select Case t
- Case vbEmpty: s = "Empty"
- Case vbError: s = "Error"
- Case vbByte: s = "Byte"
- Case vbString: s = "String"
- Case vbBoolean: s = "Boolean"
- Case vbInteger: s = "Integer"
- Case vbLong: s = "Long"
- Case vbSingle: s = "Single"
- Case vbDouble: s = "Double"
- Case vbObject: s = "Object"
- Case Else:
- s = "?" & t
- MsgBox "Unknown type: " & t
- End Select
- PropertyTypeAsString = s & s2
- End Function
-
- Public Function PropertyValueAsString(ByVal prop As Property)
- On Error Resume Next
- Dim i, l, u, t As Integer
- Dim s As String
- Dim arr As Variant
- s = "<Err>"
- t = 0
- t = prop.Type
- If (t And vbArray) <> 0 Then
- arr = prop.Value
- l = LBound(arr)
- u = UBound(arr)
- s = "("
- For i = l To u
- s = s & arr(i)
- If i < u Then s = s & ", "
- Next
- s = s & ")"
- Else
- s = prop.Value
- End If
- PropertyValueAsString = s
- End Function
-
- Public Sub PrintPropertiesToFile(ByVal props As Properties)
- On Error Resume Next
- Dim i, count As Integer
- Dim prop As Property
- count = props.count
- Print #1, " " & count & " Properties:"
- For i = 0 To count - 1
- Set prop = props(i)
- Print #1, "[" & i & "] Name " & prop.Name
- Print #1, "Flags " & PropertyFlagsAsString(prop)
- Print #1, " Type " & PropertyTypeAsString(prop)
- Print #1, "Value " & PropertyValueAsString(prop)
- Next
- End Sub
-
- Public Sub DebugPrintProperties(ByVal props As Properties)
- On Error Resume Next
- Dim i, count As Integer
- Dim prop As Property
- count = props.count
- Debug.Print " " & count & " Properties:"
- For i = 0 To count - 1
- Set prop = props(i)
- Debug.Print " Name " & prop.Name
- Debug.Print "Flags " & PropertyFlagsAsString(prop)
- Debug.Print " Type " & PropertyTypeAsString(prop)
- Debug.Print "Value " & PropertyValueAsString(prop)
- Next
- End Sub
-
- Public Sub DebugAppProperties()
- DebugPrintProperties Application.Properties
- End Sub
-
- Public Sub DebugDwgProperties()
- DebugPrintProperties ActiveDrawing.Properties
- End Sub
-
-
-