Type mismatch problem, please help
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Type mismatch problem, please help

 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA
Author Message
Jim
Guest





Posted: Thu Apr 28, 2005 12:10 am    Post subject: Type mismatch problem, please help Reply with quote

Could someone please take a look at this code exerpt and tell why I am
getting a Compile error: 'can't assign to array' with LoopStartPt
highlighted? Thanks.


'Globals for this module
Dim tubeSeed As AcadEntity
Dim LoopStartPt(0 To 1) As Double

Public Sub StPoint()

LoopStartPt = tStartPt(tubeSeed)

End Sub


Public Function tStartPt(tubeSeg As AcadEntity) As Double()
Dim Pt As Variant
Dim rtnPt(0 To 1) As Double

Dim Index As Integer

Select Case tubeSeg.ObjectName

Case Is = "AcDbPolyline"
Pt = tubeSeg.Coordinates
If IsArray(Pt) Then
rtnPt(0) = Pt(0)
rtnPt(1) = Pt(1)
End If

Case Is = "AcDbLine"
Pt = tubeSeg.StartPoint
rtnPt(0) = Pt(0)
rtnPt(1) = Pt(1)

Case Is = "AcDbArc"
Pt = acEntity.StartPoint
rtnPt(0) = Pt(0)
rtnPt(1) = Pt(1)

End Select
tStartPt = rtnPt

End Function

Back to top
Wyatt Earp
Guest





Posted: Sun May 08, 2005 4:10 pm    Post subject: Re: Type mismatch problem, please help Reply with quote

LoopStartPt = tStartPt(tubeSeed)

tStartPt returns a double
LoopStartPt is an array
tStartPt either needs to return an array, or LoopStartPt needs an
indexer.
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB