<?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 error in model in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/vb-error-in-model/m-p/626780#M20837</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Gotcha. Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Jan 2013 19:51:59 GMT</pubDate>
    <dc:creator>BarryGuidry</dc:creator>
    <dc:date>2013-01-10T19:51:59Z</dc:date>
    <item>
      <title>VB error in model</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/vb-error-in-model/m-p/626778#M20835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We have recently upgraded from Desktop 9.3 to 10.0, and now are receiving an error when running a model. Unknown if the error is due to the upgrade or not. I do know that we had problems using the field calculator upon upgrading, if a custom toolbox was saved with the 9.3 field calculator. Here is the modelbuilder error:&lt;/SPAN&gt;&lt;PRE class="plain" name="code"&gt;General error executing calculator. ERROR 999999: Error executing function. Expected end of statement Failed to execute (Calculate Field).&lt;/PRE&gt;&lt;SPAN&gt;When running the 'Calculate Field' geoprocessor with the VB code below.&lt;/SPAN&gt;&lt;PRE class="plain" name="code"&gt;Dim dblISOLEVEL As Double Dim lngJoinCnt As Long Dim dblZLEVEL as Double&amp;nbsp; lngJoinCnt = [Join_Count] dblZLEVEL = [ZLEVEL]&amp;nbsp; if (lngJoinCnt = 1) and (dblZLEVEL = 0) then dblISOLEVEL = -1 elseif (lngJoinCnt &amp;gt; 1) and (dblZLEVEL = 0) then dblISOLEVEL = dblZLEVEL elseif (lngJoinCnt = 1) and (dblZLEVEL = 5) then dblISOLEVEL = 0 elseif (lngJoinCnt &amp;gt; 1) and (dblZLEVEL = 5) then dblISOLEVEL = dblZLEVEL else&amp;nbsp; dblISOLEVEL = dblZLEVEL end if&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2013 13:59:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/vb-error-in-model/m-p/626778#M20835</guid>
      <dc:creator>BarryGuidry</dc:creator>
      <dc:date>2013-01-10T13:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: VB error in model</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/vb-error-in-model/m-p/626779#M20836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So this is VBScript code block within the field calculated in a model?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I think you variable declaration is wrong - only variant types are instantiated according to the note in the web help, see below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"VBScript does not allow you to explicitly declare any data types; all variables are implicitly Variant. Statements like Dim x as String should be removed or simplified to Dim x."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Calculate Field examples &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Resource Center » Professional Library » Data Management » Geographic data types » Tables » Calculating field values&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//005s0000002m000000" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//005s0000002m000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So test changing your var declare to the below, see if that works (leave the testing to you)---&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Good luck!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Wayne&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Dim dblISOLEVEL
Dim lngJoinCnt
Dim dblZLEVEL
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:42:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/vb-error-in-model/m-p/626779#M20836</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2021-12-12T02:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: VB error in model</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/vb-error-in-model/m-p/626780#M20837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Gotcha. Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2013 19:51:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/vb-error-in-model/m-p/626780#M20837</guid>
      <dc:creator>BarryGuidry</dc:creator>
      <dc:date>2013-01-10T19:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: VB error in model</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/vb-error-in-model/m-p/626781#M20838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So did that solve your problem?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If so, please mark this as 'answered'.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wayne&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2013 21:32:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/vb-error-in-model/m-p/626781#M20838</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-01-10T21:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: VB error in model</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/vb-error-in-model/m-p/626782#M20839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, had to even go a bit further:&lt;/SPAN&gt;&lt;PRE class="plain" name="code"&gt;Dim dblISOLEVEL Dim lngJoinCnt Dim dblZLEVEL&amp;nbsp; lngJoinCnt = CLng([Join_Count]) dblZLEVEL = CDbl([ZLEVEL])&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2013 11:52:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/vb-error-in-model/m-p/626782#M20839</guid>
      <dc:creator>BarryGuidry</dc:creator>
      <dc:date>2013-01-11T11:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: VB error in model</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/vb-error-in-model/m-p/626783#M20840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes well if the 'variant' data type can hold all those types, I suppose you'd be fine if you assigned the values directly already in the proper format, i.e. no need to use the conversion functions (CLng and CDbl) if you pass the values in that way.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So a val from an integer field could be passed directly without CLng; a val from a double field could be passed in... etc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope you got it working okay.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2013 14:47:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/vb-error-in-model/m-p/626783#M20840</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-01-11T14:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: VB error in model</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/vb-error-in-model/m-p/626784#M20841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes Sir, Mr. Whitley. It is working now.&amp;nbsp; Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2013 15:03:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/vb-error-in-model/m-p/626784#M20841</guid>
      <dc:creator>BarryGuidry</dc:creator>
      <dc:date>2013-01-11T15:03:19Z</dc:date>
    </item>
  </channel>
</rss>

