Skip to main content

IF condition syntax

Comments

2 comments

  • Nico Burgerhart

    Is myquery_result a featureset? Then you should query a specific feature in the featureset, e.g. the first: mygraphic = myquery_result.Features.First

    (perhaps you need to add an import of System.Linq to use the First method)

    To get the value of the shape len field you should write something like mygraphic.attributes("shape.len")

    To test if a value is null, you should test something like mygraphic.attributes("shape.len") is Nothing.

    A short way to check for nothing is the use of If with two arguments, s ee  http://msdn.microsoft.com/en-us/library/bb513985.aspx

    mynumericvariable = If(mygraphic.attributes("shape.len"),0)

    This means if the value is not nothing, the variable gets the value of the attribute. If the attribute is nothing, the variable gets the value 0.

     

     

    0
  • Permanently deleted user

    Many Thanks Nico -

    That worked - using "myquery_result.first().geometry is Nothing" does just what I needed. 

    0

Please sign in to leave a comment.