Quantcast
Channel: Forums - Geoprocessing
Viewing all articles
Browse latest Browse all 1751

VB error in model

$
0
0
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:
Code:

General error executing calculator.
ERROR 999999: Error executing function.
Expected end of statement
Failed to execute (Calculate Field).

When running the 'Calculate Field' geoprocessor with the VB code below.
Code:

Dim dblISOLEVEL As Double
Dim lngJoinCnt As Long
Dim dblZLEVEL as Double

lngJoinCnt = [Join_Count]
dblZLEVEL = [ZLEVEL]

if (lngJoinCnt = 1) and (dblZLEVEL = 0) then
dblISOLEVEL = -1
elseif (lngJoinCnt > 1) and (dblZLEVEL = 0) then
dblISOLEVEL = dblZLEVEL
elseif (lngJoinCnt = 1) and (dblZLEVEL = 5) then
dblISOLEVEL = 0
elseif (lngJoinCnt > 1) and (dblZLEVEL = 5) then
dblISOLEVEL = dblZLEVEL
else
dblISOLEVEL = dblZLEVEL
end if


Viewing all articles
Browse latest Browse all 1751

Latest Images

Trending Articles



Latest Images