<?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: vb2python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/vb2python/m-p/445863#M34958</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;thanks, gasior..will look at it&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 May 2012 09:26:10 GMT</pubDate>
    <dc:creator>FelixMuyoba</dc:creator>
    <dc:date>2012-05-07T09:26:10Z</dc:date>
    <item>
      <title>vb2python</title>
      <link>https://community.esri.com/t5/python-questions/vb2python/m-p/445861#M34956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hi there,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;can anyone assist me please on this query?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;a script that will require an IF statement for summing numbers cumulatively if they satisfy a certain condition or not summing them if they do not satisfy the condition. This is what i had in VB but wants that to be PYTHON:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Static rec As Double&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pStart As Double&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pInterval As Double&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pStart = 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pInterval = 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If (rec = 0) Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;rec = pStart&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;rec = rec + pInterval&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;can anyone help please?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2012 06:51:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/vb2python/m-p/445861#M34956</guid>
      <dc:creator>FelixMuyoba</dc:creator>
      <dc:date>2012-05-07T06:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: vb2python</title>
      <link>https://community.esri.com/t5/python-questions/vb2python/m-p/445862#M34957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;At &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Calculate_Field_examples/005s0000002m000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;Calculate Field examples&lt;/A&gt;&lt;SPAN&gt; help page there's a script in Python:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Code Block:
rec=0
def autoIncrement():
 global rec
 pStart = 1 #adjust start value, if req'd 
 pInterval = 1 #adjust interval value, if req'd
 if (rec == 0): 
&amp;nbsp; rec = pStart 
 else: 
&amp;nbsp; rec = rec + pInterval 
 return rec

Expression:
autoIncrement()&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:55:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/vb2python/m-p/445862#M34957</guid>
      <dc:creator>MarcinGasior</dc:creator>
      <dc:date>2021-12-11T19:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: vb2python</title>
      <link>https://community.esri.com/t5/python-questions/vb2python/m-p/445863#M34958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;thanks, gasior..will look at it&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2012 09:26:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/vb2python/m-p/445863#M34958</guid>
      <dc:creator>FelixMuyoba</dc:creator>
      <dc:date>2012-05-07T09:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: vb2python</title>
      <link>https://community.esri.com/t5/python-questions/vb2python/m-p/445864#M34959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hi gasior,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i tried those codes and they don't work and the results window in geoprocessing shows PYTHON 9.3..is there something I'm missing?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2012 11:45:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/vb2python/m-p/445864#M34959</guid>
      <dc:creator>FelixMuyoba</dc:creator>
      <dc:date>2012-05-07T11:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: vb2python</title>
      <link>https://community.esri.com/t5/python-questions/vb2python/m-p/445865#M34960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Which code doesn't work? In which tool? What errors are generated?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried to run the code in ArcGIS 9.3 Calculate Field tool. It works ok. The settings are here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]14197[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 May 2012 07:19:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/vb2python/m-p/445865#M34960</guid>
      <dc:creator>MarcinGasior</dc:creator>
      <dc:date>2012-05-09T07:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: vb2python</title>
      <link>https://community.esri.com/t5/python-questions/vb2python/m-p/445866#M34961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;thanks, Gasior everything works perfectly now..i guess it was just an oversight from side..now, how do i modify these codes to python format?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Static rec As Long&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Static dSum As Double&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim sourceField&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If ([Offset] &amp;gt; 0) Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; dSum = sourceField&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; dSum = sourceField + dSum&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;rec = rec + 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;please help!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 May 2012 10:41:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/vb2python/m-p/445866#M34961</guid>
      <dc:creator>FelixMuyoba</dc:creator>
      <dc:date>2012-05-10T10:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: vb2python</title>
      <link>https://community.esri.com/t5/python-questions/vb2python/m-p/445867#M34962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm not sure what exactly do you want to calculate. Please explain.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is a thought how Code Block may be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def conditional(sourceField, Offset):
&amp;nbsp; dSum = 0
&amp;nbsp; if Offset &amp;gt; 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp; dSum = sourceField
&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp; dSum += sourceField
&amp;nbsp; return dSum&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Expression:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;conditional(!sourceField!,!Offset!)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:55:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/vb2python/m-p/445867#M34962</guid>
      <dc:creator>MarcinGasior</dc:creator>
      <dc:date>2021-12-11T19:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: vb2python</title>
      <link>https://community.esri.com/t5/python-questions/vb2python/m-p/445868#M34963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;gasior,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;this looks exactly what I am looking for because what i want is a script that will require an IF statement for summing numbers cumulatively if they satisfy a certain condition or not summing them if they do not satisfy the condition.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2012 09:13:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/vb2python/m-p/445868#M34963</guid>
      <dc:creator>FelixMuyoba</dc:creator>
      <dc:date>2012-05-11T09:13:32Z</dc:date>
    </item>
  </channel>
</rss>

