Foxtable(狐表)用户栏目专家坐堂 → 选择框里面的<, > ,= ,<=, >=,值如何体现在代码中呢?


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

主题:选择框里面的<, > ,= ,<=, >=,值如何体现在代码中呢?

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


加好友 发短信
等级:超级版主 帖子:107131 积分:544898 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/6/19 16:30:00 [显示全部帖子]

那要使用动态函数了:http://www.foxtable.com/webhelp/topics/1487.htm



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


加好友 发短信
等级:超级版主 帖子:107131 积分:544898 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/6/20 19:56:00 [显示全部帖子]

参考:http://www.foxtable.com/webhelp/topics/0211.htm

Code = "Dim c1 As WinForm.ComboBox=e.Form.Controls(""ComboBox2"")" & vbcrlf

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


加好友 发短信
等级:超级版主 帖子:107131 积分:544898 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/6/20 21:14:00 [显示全部帖子]

要按自定义函数的标准用法定义代码。先建一个函数,把代码放到函数里,测试通过后再用到动态函数里

dim e = args(0)
dim tel1 as string = args(1)
Dim c1 As WinForm.ComboBox = e.Form.Controls("ComboBox2")
……


调用此函数:

Functions.Execute("Sum",e,tel1)


 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107131 积分:544898 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/6/21 8:29:00 [显示全部帖子]

先学会使用自定义函数:http://www.foxtable.com/webhelp/topics/1486.htm

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107131 积分:544898 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/6/24 9:45:00 [显示全部帖子]

先直接用,测试通过后再改为动态函数

If  tel1 > tel3 Then

tel2 就没有必要传入函数了

Dim Code As string
Code
 = "Dim e = args(0)" & vbcrlf
Code
 = Code & "Dim tel1 As String = args(1)" & vbcrlf
……
Code
 = Code & "If  tel1 " & tel2 & " tel3 Then" & vbcrlf
Code = Code & "If FileSys.FileExists(e) Then"
……
Functions.Add(
"Sum",Code)
Functions.Complie()

或者像9楼说的那样直接判断把

Dim e = args(0)
Dim tel1 As String = args(1)
Dim tel2 As String = args(2)
Dim tel3 As String = args(3)
Dim tel4 As String = args(4)
If (tel2 = "=" andalso  tel1 = tel3) orelse (tel2 = ">" andalso  tel1 > tel3) orelse ........  Then
    If FileSys.FileExists(e) Then
        MessageBox.Show("1")
        FileSys.CopyFile(e, tel4 & FileSys.Getname(e),True)
    End If
End If

 回到顶部