24小时热门版块排行榜    

查看: 1068  |  回复: 3

guoxy8799

金虫 (小有名气)

[求助] field calculator VBA 条件判断小程序求助

各位老师,这是在ArcGIS 里字段计算中的field calculator中advanced选项的vba小程序,想根据不同范围,为一个新字段赋值,请问这样写错误在哪里,怎么修改呢,谢谢大家。

dim output as integer
if [T_CLAY]<18 and [T_SAND]>65 then
   output=3
end if
if 18<[T_CLAY]>35 and [T_SAND]<65 then
   output=2
end if
if [T_CLAY]>35 then
  output=1
end if
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

mengxc

木虫 (著名写手)

【答案】应助回帖

guoxy8799(金币+1): 2011-06-08 08:03:52
18<[T_CLAY]>35
这样写貌似不对吧
2楼2011-06-04 15:36:59
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

yanggis

木虫 (著名写手)

小木虫GIS家族族长

【答案】应助回帖

guoxy8799(金币+4): 2011-06-08 08:03:44
dim output as integer
if [T_CLAY]<18 and [T_SAND]>65 then
   output=3
end if
elseif [T_CLAY]>35 and [T_SAND]=<65 then
   output=2
end if
elseif [T_CLAY]>=18 and [T_CLAY]=<35 then
  output=1
end if
3楼2011-06-05 10:46:33
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

杨小胖

金虫 (正式写手)

同意楼上的,18<[T_CLAY]>35 这个应该改一下,找找在vba中的语法对应
人生中最辉煌的不是功成名就的时候,而是在失败和挫折中看到希望并为之奋斗的日子
4楼2011-06-05 11:02:30
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 guoxy8799 的主题更新
信息提示
请填处理意见