The Utah GIS Portal Forum uses standard BBCode style markup tags to allow users to format their posts. If you need to include a code sample (like the one below) in a post make sure that you surround it with begin and end code tags (from the Boardcode formatting buttons). This will preserve you formatting and indenting and will display the code using a fixed width font.
Note: the nice formatting will not appear in the preview window.
| Code: |
Public Sub SetNull()
'Set null values for selected features in specified field'
Dim pDispTab As IDisplayTable
Dim pMXD As IMxDocument
Dim pTable As ITable
Dim pCursor As ICursor
Dim pRow As IRow
Dim pMap As IMap
Dim pFSel As IFeatureSelection
Dim pSelSet As ISelectionSet
Dim pFLayer As IFeatureLayer
Set pMXD = ThisDocument
Set pMap = pMXD.FocusMap
Set pFSel = pMap.Layer(1)
Set pSelSet = pFSel.SelectionSet
Set pFLayer = pFSel
pSelSet.Search Nothing, False, pCursor
Set pRow = pCursor.NextRow
Do While Not pRow Is Nothing
'enter the name of the field below'
pRow.Value(pFLayer.FeatureClass.FindField("MYFIELD")) = Null
pRow.Store
Set pRow = pCursor.NextRow
Loop
End Sub
|