Quantcast
Channel: Forums - ArcObjects SDKs
Viewing all articles
Browse latest Browse all 1374

pMarker not assigned a value?

$
0
0
Quick question. I have some old code that I have brought over from VB Script and just wanted to see why this error is coming up.

Warning: Variable 'pMarker' is used before it has been assigned a value. A null reference exception could result at runtime.

From what I can see, I'm assigning a value in the Do Until Loop...is there something I'm missing?

Code:

Dim pMarker As IMarkerSymbol
        Do Until pStyleItem Is Nothing
            If pStyleItem.Name = "Star 1" Then
                pMarker = pStyleItem.Item
                pMarker.Size = 12
                pMarker.Color = pColor
                Exit Do
            End If
            pStyleItem = pEnumMarkers.Next
        Loop

        Dim prenderer As ISimpleRenderer
        prenderer = New SimpleRenderer
        prenderer.Symbol = pMarker


Viewing all articles
Browse latest Browse all 1374

Trending Articles