IF condition syntax
I have a VERY simple condition I need to write using Workflow-friendly syntax. The condition is simply "if the shape.len field in myquery_result dataset is null" which dictates the 'then' and 'else' flow. That part is easy, but I cannot see how to write the condition in a way that Workflow understands.
"myquery_result.shape.len is null" is what I need it to say, but I know there is more complicated syntax needed. Any tips?
Thanks -
Allen Scully
City of Tucson, AZ
520 837 6018
-
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 -
Many Thanks Nico -
That worked - using "myquery_result.first().geometry is Nothing" does just what I needed.
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
2 Kommentare