home *** CD-ROM | disk | FTP | other *** search
- '******************************************************************
- '* *
- '* TurboCAD for Windows *
- '* Copyright (c) 1993 - 1996 *
- '* International Microcomputer Software, Inc. *
- '* (IMSI) *
- '* All rights reserved. *
- '* *
- '******************************************************************
- ' This file gets appended to scripts. These routines are '
- ' used to support getting and setting properties. They '
- ' were written to get around a missing feature in Enable '
- ' Basic - Variants are not supported with dlls. '
- ' DO NOT CHANGE THIS FILE '
-
- Declare Function TCWGetIntResult lib "TCAPI50" ( _
- ) As Integer
-
- Declare Function TCWGetLongResult lib "TCAPI50" ( _
- ) As Long
-
- Declare Function TCWGetDoubleResult lib "TCAPI50" ( _
- ) As Double
-
- Declare Function TCWGetStringResult lib "TCAPI50" ( _
- ByRef tcwstr As String _
- )
-
- Declare Function TCWLayerPropertySetInt lib "TCAPI50" ( _
- ByVal tcwl As Long, _
- ByRef tcwstr As String, _
- ByVal tcwvalue As Integer _
- )As Long
-
- Declare Function TCWLayerPropertySetLong lib "TCAPI50" ( _
- ByVal tcwl As Long, _
- ByRef tcwstr As String, _
- ByVal tcwvalue As Long _
- )As Long
-
- Declare Function TCWLayerPropertySetString lib "TCAPI50" ( _
- ByVal tcwl As Long, _
- ByRef tcwstr As String, _
- ByRef tcwvalue As String _
- )As Long
-
- Declare Function TCWAppPropertySetInt lib "TCAPI50" ( _
- ByRef tcwstr As String, _
- ByVal tcwvalue As Integer _
- )As Long
-
- Declare Function TCWAppPropertySetLong lib "TCAPI50" ( _
- ByRef tcwstr As String, _
- ByVal tcwvalue As Long _
- )As Long
-
- Declare Function TCWAppPropertySetDbl lib "TCAPI50" ( _
- ByRef tcwstr As String, _
- ByVal tcwvalue As Double _
- ) As Long
-
- Declare Function TCWAppPropertySetString lib "TCAPI50" ( _
- ByRef tcwstr As String, _
- ByRef tcwvalue As String _
- )As Long
-
- Declare Function TCWDrawingPropertySetInt lib "TCAPI50" ( _
- ByRef tcwstr As String, _
- ByVal tcwvalue As Integer _
- )As Long
-
- Declare Function TCWDrawingPropertySetLong lib "TCAPI50" ( _
- ByRef tcwstr As String, _
- ByVal tcwvalue As Long _
- )As Long
-
- Declare Function TCWDrawingPropertySetDbl lib "TCAPI50" ( _
- ByRef tcwstr As String, _
- ByVal tcwvalue As Double _
- )As Long
-
- Declare Function TCWDrawingPropertySetString lib "TCAPI50" ( _
- ByRef tcwstr As String, _
- ByRef tcwvalue As String _
- )As Long
-
- Declare Function TCWGraphicPropertySetInt lib "TCAPI50" ( _
- ByVal tcwg As Long, _
- ByRef tcwstr As String, _
- ByVal tcwvalue As Integer _
- )As Long
-
- Declare Function TCWGraphicPropertySetLong lib "TCAPI50" ( _
- ByVal tcwg As Long, _
- ByRef tcwstr As String, _
- ByVal tcwvalue As Long _
- )As Long
-
- Declare Function TCWGraphicPropertySetDbl lib "TCAPI50" ( _
- ByVal tcwg As Long, _
- ByRef tcwstr As String, _
- ByVal tcwvalue As Double _
- )As Long
-
- Declare Function TCWGraphicPropertySetString lib "TCAPI50" ( _
- ByVal tcwg As Long, _
- ByRef tcwstr As String, _
- ByRef tcwvalue As String _
- )As Long
-
- Declare Function TCWLayerPropertyGetX lib "TCAPI50" ( _
- ByVal tcwlayer As Long, _
- ByRef tcwpropertyname As String _
- ) As Long
-
- Declare Function TCWAppPropertyGetX lib "TCAPI50" ( _
- ByRef tcwpropertyname As String _
- ) As Long
-
- Declare Function TCWDrawingPropertyGetX lib "TCAPI50" ( _
- ByRef tcwpropertyname As String _
- ) As Long
-
- Declare Function TCWGraphicPropertyGetX lib "TCAPI50" ( _
- ByVal tcwg As Long, _
- ByRef tcwpropertyname As String _
- ) As Long
-
- 'Functions begin
- Function TCWAppPropertyGet(ByVal tcwstr As String) As Variant
- Dim tcwResult As Variant
- Dim tcwRType As Long
-
- tcwRType = TCWAppPropertyGetX(tcwstr)
- tcwResult = TCWGetResult(tcwRType)
- TCWAppPropertyGet = tcwResult
-
- End Function
-
- Function TCWAppPropertySet(ByVal tcwstr As String, ByVal tcwvalue As Variant) As Long
- Dim tcwResult As Long
- Dim tcwRType As Long
- Dim tcwIType As Integer
- Dim tcwLType As Long
- Dim tcwDType As Double
- Dim tcwSType As String
- Dim vt As Long
-
- vt = TCWAppPropertyGetX(tcwstr)
- If (vt = 2) Then
- tcwIType = tcwvalue
- tcwResult = TCWAppPropertySetInt(tcwstr, tcwIType)
- ElseIf (vt = 3) Then
- tcwLType = tcwvalue
- tcwResult = TCWAppPropertySetLong(tcwstr, tcwLType)
- ElseIf (vt = 5) Then
- tcwDType = tcwvalue
- tcwResult = TCWAppPropertySetDbl(tcwstr, tcwDType)
- ElseIf (vt = 8) Then
- tcwSType = tcwvalue
- tcwResult = TCWAppPropertySetString(tcwstr, tcwSType)
- ElseIf (vt = 11) Then
- tcwIType = tcwvalue
- tcwResult = TCWAppPropertySetInt(tcwstr, tcwIType)
- Else
- MsgBox "Property type " & vt & " not supported"
- End If
-
- TCWAppPropertySet = tcwResult
-
- End Function
-
-
- Function TCWDrawingPropertyGet(ByVal tcwstr As String) As Variant
- Dim tcwResult As Variant
- Dim tcwRType As Long
-
- tcwRType = TCWDrawingPropertyGetX(tcwstr)
- tcwResult = TCWGetResult(tcwRType)
- TCWDrawingPropertyGet = tcwResult
-
- End Function
-
- Function TCWDrawingPropertySet(ByVal tcwstr As String, ByVal tcwvalue As Variant) As Long
- Dim tcwResult As Long
- Dim tcwRType As Long
- Dim tcwIType As Integer
- Dim tcwLType As Long
- Dim tcwDType As Double
- Dim tcwSType As String
- Dim vt As Long
-
- vt = TCWDrawingPropertyGetX(tcwstr)
- If (vt = 2) Then
- tcwIType = tcwvalue
- tcwResult = TCWDrawingPropertySetInt(tcwstr, tcwIType)
- ElseIf (vt = 3) Then
- tcwLType = tcwvalue
- tcwResult = TCWDrawingPropertySetLong(tcwstr, tcwLType)
- ElseIf (vt = 5) Then
- tcwDType = tcwvalue
- tcwResult = TCWDrawingPropertySetDbl(tcwstr, tcwDType)
- ElseIf (vt = 8) Then
- tcwSType = tcwvalue
- tcwResult = TCWDrawingPropertySetSTring(tcwstr, tcwSType)
- ElseIf (vt = 11) Then
- tcwIType = tcwvalue
- tcwResult = TCWDrawingPropertySetInt(tcwstr, tcwIType)
- Else
- MsgBox "Property type " & vt & " not supported"
- End If
-
- TCWDrawingPropertySet = tcwResult
-
- End Function
-
- Function TCWGraphicPropertyGet(ByVal tcwg As Long, ByVal tcwstr As String) As Variant
- Dim tcwResult As Variant
- Dim tcwRType As Long
-
- tcwRType = TCWGraphicPropertyGetX(tcwg, tcwstr)
- tcwResult = TCWGetResult(tcwRType)
- TCWGraphicPropertyGet = tcwResult
-
- End Function
-
- Function TCWGraphicPropertySet(ByVal tcwg As Long, ByVal tcwstr As String, ByVal tcwvalue As Variant) As Long
- Dim tcwResult As Long
- Dim tcwRType As Long
- Dim tcwIType As Integer
- Dim tcwLType As Long
- Dim tcwDType As Double
- Dim tcwSType As String
- Dim vt As Long
-
- vt = TCWGraphicPropertyGetX(tcwg, tcwstr)
- If (vt = 2) Then
- tcwIType = tcwvalue
- tcwResult = TCWGraphicPropertySetInt(tcwg, tcwstr, tcwIType)
- ElseIf (vt = 3) Then
- tcwLType = tcwvalue
- tcwResult = TCWGraphicPropertySetLong(tcwg, tcwstr, tcwLType)
- ElseIf (vt = 5) Then
- tcwDType = tcwvalue
- tcwResult = TCWGraphicPropertySetDbl(tcwg, tcwstr, tcwDType)
- ElseIf (vt = 8) Then
- tcwSType = tcwvalue
- tcwResult = TCWGraphicPropertySetString(tcwg, tcwstr, tcwSType)
- ElseIf (vt = 11) Then
- tcwIType = tcwvalue
- tcwResult = TCWGraphicPropertySetInt(tcwg, tcwstr, tcwIType)
- Else
- MsgBox "Property type " & vt & " not supported"
- End If
-
- TCWGraphicPropertySet = tcwResult
-
- End Function
-
- Function TCWLayerPropertyGet(ByVal tcwl As Long, ByVal tcwstr As String) As Variant
- Dim tcwResult As Variant
- Dim tcwRType As Long
-
- tcwRType = TCWLayerPropertyGetX(tcwl, tcwstr)
- tcwResult = TCWGetResult(tcwRType)
-
- TCWLayerPropertyGet = tcwResult
-
- End Function
-
- Function TCWLayerPropertySet(ByVal tcwl As Long, ByVal tcwstr As String, ByVal tcwvalue As Variant) As Long
- Dim tcwResult As Long
- Dim tcwRType As Long
- Dim tcwIType As Integer
- Dim tcwLType As Long
- Dim tcwSType As String
- Dim vt As Long
-
- vt = TCWLayerPropertyGetX(tcwl, tcwstr)
- If (vt = 2) Then
- tcwIType = tcwvalue
- tcwResult = TCWLayerPropertySetInt(tcwl, tcwstr, tcwIType)
- ElseIf (vt = 3) Then
- tcwLType = tcwvalue
- tcwResult = TCWLayerPropertySetLong(tcwl, tcwstr, tcwLType)
- ElseIf (vt = 8) Then
- tcwSType = tcwvalue
- tcwResult = TCWLayerPropertySetString(tcwl, tcwstr, tcwSType)
- ElseIf (vt = 11) Then
- tcwIType = tcwvalue
- tcwResult = TCWLayerPropertySetInt(tcwl, tcwstr, tcwIType)
- Else
- MsgBox "Property type " & vt & " not supported"
- End If
-
- TCWLayerPropertySet = tcwResult
-
- End Function
-
- Function TCWGetResult(ByVal tcwret As Long) As Variant
- Dim tcwResult As Variant
- Dim tcwIType As Integer
- Dim tcwDType As Double
- Dim tcwLType As Long
- Dim tcwSType As String
-
- If (tcwret = 0) Then
- tcwResult = 0
- ElseIf (tcwret = 2) Then
- tcwIType = TCWGetIntResult()
- tcwResult = tcwIType
- ElseIf (tcwret = 3) Then
- tcwLType = TCWGetLongResult()
- tcwResult = tcwLType
- ElseIf (tcwret = 5) Then
- tcwDType = TCWGetDoubleResult()
- tcwResult = tcwDType
- ElseIf (tcwret = 8) Then
- TCWGetStringResult tcwSType
- tcwResult = tcwSType
- ElseIf (tcwret = 11) Then
- tcwIType = TCWGetIntResult()
- tcwResult = tcwIType
- End If
-
- TCWGetResult = tcwResult
- End Function
-
-