易表在线答疑技术与交流应用技巧 → 看看我的超长巨无霸公式……


  共有61206人关注过本帖树形打印复制链接

主题:看看我的超长巨无霸公式……

帅哥哟,离线,有人找我吗?
流星怪客
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游民 帖子:75 积分:0 威望:0 精华:0 注册:2008/1/9 13:39:00
  发帖心情 Post By:2008/1/9 13:45:00 [显示全部帖子]

为何不使用字符串组合的方法式精简代码呢,

 回到顶部
帅哥哟,离线,有人找我吗?
流星怪客
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游民 帖子:75 积分:0 威望:0 精华:0 注册:2008/1/9 13:39:00
  发帖心情 Post By:2008/1/9 13:48:00 [显示全部帖子]

 If([说明] <> Cell(Row - 1,"说明"),Selcase([说明] = "高筋粉","A001",[说明] = "低筋粉","B001",[说明] = "面包粉","C001",[说明] = "蛋糕粉","D001",[说明] = "糕粉","E001",[说明] = "其他粉类","F001",[说明] = "食用糖类","G001",[说明] = "食用油","H001",[说明] = "奶油类","I001",[说明] = "添加剂","J001",[说明] = "外购半成品","K001",[说明] = "饮料类","L001",[说明] = "月饼粉","M001",[说明] = "月饼馅料","N001",[说明] = "其他馅料类","O001",[说明] = "其他原材料","P001",[说明] = "燃料及动力","Q001",[说明] = "辅助材料","R001",[说明] = "其他辅助材料","S001",[说明] = "包装袋","T001",[说明] = "包装盒","U001",[说明] = "包装膜","V001",[说明] = "包装箱","W001",[说明] = "其他包装材料","X001",[说明] = "大米","Y001",[说明] = "后勤物资","Z001",[说明] = "维修材料","①001",[说明] = "低值易耗品","②001"),If(Number(Right(Cell(Row - 1,Col),3)) <9,Concat(Left(Cell(Row - 1,Col),Len(Text(Cell(Row - 1,Col))) - 3),"00",Text(Number(Right(Cell(Row - 1,Col),3)) + 1)),If(Number(Right(Cell(Row - 1,Col),3)) < 99,Concat(Left(Cell(Row - 1,Col),Len(Text(Cell(Row - 1,Col))) - 3),"0",Text(Number(Right(Cell(Row - 1,Col),3)) + 1)),Concat(Left(Cell(Row - 1,Col),Len(Text(Cell(Row - 1,Col))) - 3),Text(Number(Right(Cell(Row - 1,Col),3))+1)))))
像这段代码如果用你的方法,代码就不知有多少了

 回到顶部
帅哥哟,离线,有人找我吗?
流星怪客
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游民 帖子:75 积分:0 威望:0 精华:0 注册:2008/1/9 13:39:00
  发帖心情 Post By:2008/8/1 8:51:00 [显示全部帖子]

把通用公式全写为表达式变量,相当于我们在VB,C,或ASP中编程时的自定义模块,需要时到处可调用.所以个人认为,代码要便于维护,要精炼,不是什么东西都弄在一起,其实在易表中,谈不上编程,只是很多函数用AND 连在一起,而具有程序设计思想的只有两个条件语句和循环。所以一般人用易表只要1个星期的入门时间。(如果这就是巨无霸,那你看到应用程开发,那就不知道是啥子感想了!呵呵)

 回到顶部