<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: VB Script Code block newbie question re: IF statment in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/vb-script-code-block-newbie-question-re-if/m-p/737731#M57104</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Don't "dim AS" in VB Script (if you really want to, you can dim by itself, but why bother?)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;diam = [DIAMETER_1]
pipe = [New_Pipe_S]

if pipe = 0 then
 X =&amp;nbsp; diam
else
 X = pipe
end if


Final_Dia =
X&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 07:25:51 GMT</pubDate>
    <dc:creator>DarrenWiens2</dc:creator>
    <dc:date>2021-12-12T07:25:51Z</dc:date>
    <item>
      <title>VB Script Code block newbie question re: IF statment</title>
      <link>https://community.esri.com/t5/python-questions/vb-script-code-block-newbie-question-re-if/m-p/737728#M57101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I get a general error for this simple code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;dim [DIAMETER_1] as number dim [New_Pipe_S] as number dim X as number&amp;nbsp; if [New_Pipe_S] = 0 then&amp;nbsp; X = [DIAMETER_1] else&amp;nbsp; X = [New_Pipe_S] end if&amp;nbsp;&amp;nbsp;&amp;nbsp; Final_Dia = X&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]19945[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2012 15:38:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/vb-script-code-block-newbie-question-re-if/m-p/737728#M57101</guid>
      <dc:creator>PeterPeng</dc:creator>
      <dc:date>2012-12-14T15:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: VB Script Code block newbie question re: IF statment</title>
      <link>https://community.esri.com/t5/python-questions/vb-script-code-block-newbie-question-re-if/m-p/737729#M57102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Don't declare and use the field references as variables&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;declare a variable, set it to the field value, and use the variable in the code&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;dim diam as number
dim pipe as number
dim X as number

diam = [DIAMETER_1]
pipe = [New_Pipe_S]

if pipe = 0 then
 X =&amp;nbsp; diam
else
 X = pipe
end if


Final_Dia =
X&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:25:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/vb-script-code-block-newbie-question-re-if/m-p/737729#M57102</guid>
      <dc:creator>markdenil</dc:creator>
      <dc:date>2021-12-12T07:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: VB Script Code block newbie question re: IF statment</title>
      <link>https://community.esri.com/t5/python-questions/vb-script-code-block-newbie-question-re-if/m-p/737730#M57103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tried that and it didn't work either, same general error 99999. All 3 fields were originally formated as Long and Short Integers in ArcMap. It's stored in a shapefile and I don't have the ArcMap spatial anaylist license, if that makes a difference :(? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any other thoughts?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Much appreciated!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2012 16:09:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/vb-script-code-block-newbie-question-re-if/m-p/737730#M57103</guid>
      <dc:creator>PeterPeng</dc:creator>
      <dc:date>2012-12-14T16:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: VB Script Code block newbie question re: IF statment</title>
      <link>https://community.esri.com/t5/python-questions/vb-script-code-block-newbie-question-re-if/m-p/737731#M57104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Don't "dim AS" in VB Script (if you really want to, you can dim by itself, but why bother?)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;diam = [DIAMETER_1]
pipe = [New_Pipe_S]

if pipe = 0 then
 X =&amp;nbsp; diam
else
 X = pipe
end if


Final_Dia =
X&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:25:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/vb-script-code-block-newbie-question-re-if/m-p/737731#M57104</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-12T07:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: VB Script Code block newbie question re: IF statment</title>
      <link>https://community.esri.com/t5/python-questions/vb-script-code-block-newbie-question-re-if/m-p/737732#M57105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;nevermind, someone at Stack answered my question!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://gis.stackexchange.com/questions/44008/field-calculator-vb-script-codeblock-if-statement-syntax-is-wrong" rel="nofollow" target="_blank"&gt;http://gis.stackexchange.com/questions/44008/field-calculator-vb-script-codeblock-if-statement-syntax-is-wrong&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks all!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(fyi here is the correct one)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim Output&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If&amp;nbsp; [New_Pipe_S] = 0 Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Output = [DIAMETER]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Output&amp;nbsp; = [New_Pipe_S]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Final_Dia =&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Output&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2012 16:32:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/vb-script-code-block-newbie-question-re-if/m-p/737732#M57105</guid>
      <dc:creator>PeterPeng</dc:creator>
      <dc:date>2012-12-14T16:32:42Z</dc:date>
    </item>
  </channel>
</rss>

