Foxtable(狐表)用户栏目专家坐堂 → 多分支条件问题,求解


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

主题:多分支条件问题,求解

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/5/29 10:56:00 [显示全部帖子]

 加入msgbox调试一下

 

http://www.foxtable.com/help/topics/1485.htm

 


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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/5/29 11:20:00 [显示全部帖子]

Dim Result As String '储存生成结果
Dim Start As String = e.Form.Controls("TextBox1").Value '起始号码
Dim Number As String = e.Form.Controls("TextBox2").Value '生成数量
Dim nEnd As Integer = CInt(Start) + CInt(Number) - 1 '结束号码
Dim fmt As String = "".PadLeft(Start.Length,"0") '获取起始字符占位
Dim tj() As String
Dim t5 As String = e.Form.Controls("TextBox5").Text
If t5 <> Nothing Then
    tj =  t5.Split(",") '条件输入
End If
Dim gds As String = e.Form.Controls("TextBox3").Value '获取固定首位字符
Dim gdw As String = e.Form.Controls("TextBox3").Value '获取固定尾部字符

For i As Integer = Start To nEnd
    If e.Form.Controls("CheckBox1").Checked And t5 <> Nothing  Then '尾数跳过条件成立
        If Array.LastIndexOf(tj,CStr(i Mod 10)) = -1 Then
            Result &= Format(i,fmt) & vbcrlf
        End If
    Else If e.Form.Controls("CheckBox2").Checked And t5 <> Nothing Then '全部跳过条件成立
        Dim b As Boolean = True
        For s As Integer = 0 To tj.Length - 1
            If CStr(i).Contains(tj(s)) Or Format(i,fmt).Contains(tj(s)) Then
                b = False
            End If
        Next
        If b Then
            Result &= Format(i,fmt) & vbcrlf
        End If
    Else If e.Form.Controls("CheckBox3").Checked And t5 <> Nothing  Then '重复条件成立
        For x As Integer = 1 To tj(0)
            Result &= Format(i,fmt) & vbcrlf
        Next
    Else
        Result &= Format(i,fmt) & vbcrlf
    End If
Next

Dim save As New SaveFileDialog
save.Filter = "文本文件|*.txt"
save.Title = "保存数据"
save.OverwritePrompt = True
If save.ShowDialog = DialogResult.OK Then
    FileSys.WriteAllText(save.FileName,Result,False,Encoding.Unicode)
End If


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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/5/29 15:36:00 [显示全部帖子]

Dim qs As Integer = 1
Dim js As Integer = 10
Dim s As Integer = 0
Dim i As Integer = qs
Do While s <= js - qs
    If CStr(i).Contains("4") = False Then
        s += 1
        Output.Show(i & vbcrlf)
    End If
    i = i + 1
Loop

 回到顶部