.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Name ... Not Declared

3 REPLIES 3
Reply
Message 1 of 4
sgrya1
291 Views, 3 Replies

Name ... Not Declared

Very new to .NET but can someone help me out with this? I can see that getEndPointOptions shouldn't be dimmed twice but don't know how to fix it. Also getEndPointOptions in bold is "not declared" for some reason.

Can anyone help me?

'Get Start Point
If FirstSpan = True Then
Dim getStartPointOptions As PromptPointOptions = New PromptPointOptions("Locate start point:")
Dim getStartPointResult As PromptPointResult = ed.GetPoint(getStartPointOptions)
If (getStartPointResult.Status = PromptStatus.OK) Then
sp = getStartPointResult.Value
End If
End If
'Get EndPoint
If FirstSpan = True Then
Dim getEndPointOptions As PromptPointOptions = New PromptPointOptions("Locate first high point:")
Else
Dim getEndPointOptions As PromptPointOptions = New PromptPointOptions("Locate next high point:")
End If
Dim getEndPointResult As PromptPointResult = ed.GetPoint(getEndPointOptions)
3 REPLIES 3
Message 2 of 4
sgrya1
in reply to: sgrya1

Sorry, ignore this.

I'm going through tutorials and not used to dimming a variable at the same time as setting it to a value.

Realise now that I can still dim it and then set it later.
Message 3 of 4
chiefbraincloud
in reply to: sgrya1

Just in case, I will mention that another difference between VBA and VB .NET is in the fact that in .NET a variable declared inside a block of code will fall out of scope at the end of that code block. for example, your If statement. anything declared inside the If...End If will not exist after the End If.
Dave O.                                                                  Sig-Logos32.png
Message 4 of 4
sgrya1
in reply to: sgrya1

Thanks for the reply. I got the feeling that was the case when I was shifting lines around. Good to know that that is the reason.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost