易表在线答疑技术与交流用户社区 → 强烈建议恢复eval 六步曲的原帖子呀。


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

主题:强烈建议恢复eval 六步曲的原帖子呀。

美女呀,离线,留言给我吧!
金银花
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:侠之大者 帖子:575 积分:482 威望:0 精华:0 注册:2006/8/17 6:37:00
  发帖心情 Post By:2012/6/17 7:00:00 [显示全部帖子]

 

Eval公式六步曲

左拼部分 + 用Substitute把分隔符替换部分(中间) + 右凑部分


1、       写出列表集(此较为关键):

[%JC%]=ListFor("客户档案","简称",1)


[%JC%]→一翻二

Eval("Substitute(""|@|"",""|"","""+Substitute([%JC%],"|",""")+""|""+Substitute(""|@|"",""|"",""")+""")")


2写出最简单的循环命令。

  ReplaceFor(Grid,"简称","A","进货单位","Instr","A") And ReplaceFor(Grid,"简称","B","进货单位","Instr","B")


3把第2的命令粘贴到记事本中:

编辑→查找替换→在查找框输入:『"』→在在查找框输入:『""』→全部替换,得到 (此时列表为:A@A|B@B)

ReplaceFor(Grid,""简称"",""A"",""进货单位"",""Instr"",""A

(左拼部分)        (A)  (A@A及B@B間的“@”)    (A)

"") And ReplaceFor(Grid,""简称"",""B"",""进货单位"",""Instr"",""B"")

右凑部分

(A|B間的“|”)        (B






4用Substitute把第1的列表集中的分隔符“@”和“|”分別替换为 第3点字符集中的红色部分『"",""进货单位"",""Instr"",""』,和粉紅色部分『"") And ReplaceFor(Grid,""简称"",""』,

得到中间部分:

  Substitute(Substitute(Eval("Substitute(""|@|"",""|"","""+Substitute([%JC%],"|",""")+""|""+Substitute(""|@|"",""|"",""")+""")")

,"@"," "",""进货单位"",""Instr"","""),"|",""") And ReplaceFor(Grid,""简称"",""")


5加上『左拼部分』(第3中列表第一个字符前面所有字符)和『右凑部分』(第3中列表最后字符后面所有字符)

" ReplaceFor(Grid,""简称"","""+Substitute(Substitute(Eval("Substitute(""|@|"",""|"","""+Substitute([%JC%],"|",""")+""|""+Substitute(""|@|"",""|"",""")+""")")

,"@"," "",""进货单位"",""Instr"","""),"|",""") And ReplaceFor(Grid,""简称"",""")

+""")"


6最后用Eval执行它,OK!


Eval(" ReplaceFor(Grid,""简称"","""+Substitute(Substitute(Eval("Substitute(""|@|"",""|"","""+Substitute([%JC%],"|",""")+""|""+Substitute(""|@|"",""|"",""")+""")")

,"@"," "",""进货单位"",""Instr"","""),"|",""") And ReplaceFor(Grid,""简称"",""")

+""")")



 回到顶部