欢迎来到冰点文库! | 帮助中心 分享价值,成长自我!
冰点文库
全部分类
  • 临时分类>
  • IT计算机>
  • 经管营销>
  • 医药卫生>
  • 自然科学>
  • 农林牧渔>
  • 人文社科>
  • 工程科技>
  • PPT模板>
  • 求职职场>
  • 解决方案>
  • 总结汇报>
  • ImageVerifierCode 换一换
    首页 冰点文库 > 资源分类 > DOCX文档下载
    分享到微信 分享到微博 分享到QQ空间

    触发器代码.docx

    • 资源ID:14717093       资源大小:163.39KB        全文页数:19页
    • 资源格式: DOCX        下载积分:5金币
    快捷下载 游客一键下载
    账号登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录 QQ登录
    二维码
    微信扫一扫登录
    下载资源需要5金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP,免费下载
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    触发器代码.docx

    1、触发器代码Dim a, b, c, d, f(0 To 9), g(0 To 9), j(0 To 9), k(0 To 9), l(0 To 9), m(0 To 9), i, N, e, r, s, t As Integer 定义变量和数组Private Sub Command1_Click()If IsNumeric(Text1.Text) = False Then 如输入不为数字 MsgBox 输入有误 弹出对话框 Text1.Text = : Text1.SetFocus: Exit Sub 清空Text光标在Text闪烁,并退出Sub End Ifa = Val(Text1.Tex

    2、t)Label2.Caption = : Label3.Caption = 清空LabelLabel5.Caption = : Label4.Caption = Qn1Select Case (a) Select Case语句选择Case 1Text3.Enabled = True Text变为不能输入Text5.Enabled = FalseText2.MaxLength = 1: Text3.MaxLength = 1 Text最大输入长度为1Label2.Caption = S: Label3.Caption = RCase 2Text3.Enabled = True: Text5.En

    3、abled = FalseText2.MaxLength = 1: Text3.MaxLength = 1Label2.Caption = J: Label3.Caption = KCase 3Text3.Enabled = False: Text5.Enabled = FalseText2.MaxLength = 1: Label2.Caption = DCase 4Text3.Enabled = False: Text5.Enabled = FalseText2.MaxLength = 1: Label2.Caption = TCase 11Text3.Enabled = True: Te

    4、xt5.Enabled = FalseText2.MaxLength = 10: Text3.MaxLength = 10Label2.Caption = S序列: Label3.Caption = R序列Case 22Text3.Enabled = True: Text5.Enabled = FalseText2.MaxLength = 10: Text3.MaxLength = 10Label2.Caption = J序列: Label3.Caption = K序列Case 33Text3.Enabled = False: Text5.Enabled = FalseText2.MaxLen

    5、gth = 10: Label2.Caption = D序列Case 44Text3.Enabled = False: Text5.Enabled = FalseText2.MaxLength = 10: Label2.Caption = T序列Case 12Text3.Enabled = True: Text5.Enabled = TrueLabel2.Caption = S序列: Label3.Caption = R序列: Label5.Caption = Qn2Case 13Text3.Enabled = True: Text5.Enabled = TrueLabel2.Caption

    6、= S序列: Label3.Caption = R序列: Label5.Caption = Qn2Case 14Text3.Enabled = True: Text5.Enabled = TrueLabel2.Caption = S序列: Label3.Caption = R序列: Label5.Caption = Qn2Case 23Text3.Enabled = True: Text5.Enabled = TrueLabel2.Caption = J序列: Label3.Caption = K序列: Label5.Caption = Qn2Case 24Text3.Enabled = Tr

    7、ue: Text5.Enabled = TrueLabel2.Caption = J序列: Label3.Caption = K序列: Label5.Caption = Qn2Case 34Text3.Enabled = False: Text5.Enabled = TrueLabel2.Caption = D序列: Label5.Caption = Qn2Case ElseLabel4.Caption = MsgBox 输入有误: Exit Sub: End Select: End SubPrivate Sub Command2_Click()Form1.Cls 清空Form If IsNu

    8、meric(Text1.Text) = False Then MsgBox 输入有误: Text1.Text = : Text1.SetFocus: Exit Sub End If If IsNumeric(Text2.Text) = False Then MsgBox 输入有误: Text2.Text = : Text2.SetFocus: Exit Sub End If If IsNumeric(Text4.Text) = False Then MsgBox 输入有误: Text4.Text = : Text4.SetFocus: Exit Sub End Ifa = Val(Text1.

    9、Text): b = Val(Text2.Text)c = Val(Text3.Text): d = Val(Text4.Text): r = Val(Text5.Text)Select Case (a)Case 1If IsNumeric(Text3.Text) = False Then MsgBox 输入有误: Text3.Text = : Text3.SetFocus: Exit Sub End If If b = 1 And c = 1 ThenMsgBox 不允许: Exit SubElseIf b = 0 And c = 0 Thene = dElseIf b = 0 And c

    10、= 1 Thene = 0ElseIf b = 1 And c = 0 Thene = 1End If: End If: End If: End Ift = e: Print eCase 2If IsNumeric(Text3.Text) = False Then MsgBox 输入有误: Text3.Text = : Text3.SetFocus: Exit Sub End IfIf b = 0 And c = 0 Thene = dElseIf b = 0 And c = 1 Thene = 0ElseIf b = 1 And c = 0 Thene = 1ElseIf b = 1 And

    11、 c = 1 And d = 0 Thene = 1ElseIf b = 1 And c = 1 And d = 1 Thene = 0End If: End If: End If: End If: End If: Print eCase 3e = b: Print eCase 4If b = 0 Thene = dElseIf b = 1 And d = 0 Thene = 1ElseIf b = 1 And d = 1 Thene = 0End If: End If: End If: Print eCase 11If IsNumeric(Text3.Text) = False Then M

    12、sgBox 输入有误: Text3.Text = : Text3.SetFocus: Exit Sub End IfN = Len(Text2.Text) 取Text里内容的长度For i = N - 1 To 0 Step -1If b = 10 i Thenf(i) = 1Elsef(i) = 0End IfIf c = 10 i Theng(i) = 1Elseg(i) = 0End IfIf f(i) = 0 And g(i) = 0 Thene = dElseIf f(i) = 0 And g(i) = 1 Thene = 0ElseIf f(i) = 1 And g(i) = 0

    13、Thene = 1ElseIf f(i) = 1 And g(i) = 1 ThenMsgBox 不允许: Exit SubEnd If: End If: End If: End If: Print ed = e: b = b - f(i) * (10 i): c = c - g(i) * (10 i)Next iCase 22If IsNumeric(Text3.Text) = False Then MsgBox 输入有误: Exit Sub: Text3.Text = : Text3.SetFocus End IfN = Len(Text2.Text)For i = N - 1 To 0

    14、Step -1If b = 10 i Thenf(i) = 1Elsef(i) = 0End IfIf c = 10 i Theng(i) = 1Elseg(i) = 0End IfIf f(i) = 0 And g(i) = 0 Thene = dElseIf f(i) = 0 And g(i) = 1 Thene = 0ElseIf f(i) = 1 And g(i) = 0 Thene = 1ElseIf f(i) = 1 And g(i) = 1 And d = 0 Thene = 1ElseIf f(i) = 1 And g(i) = 1 And d = 1 Thene = 0End

    15、 If: End If: End If: End If: End If: Print ed = e: b = b - f(i) * (10 i): c = c - g(i) * (10 i)Next iCase 33N = Len(Text2.Text)For i = N - 1 To 0 Step -1If b = 10 i Thenf(i) = 1Elsef(i) = 0End Ife = f(i)Print eb = b - f(i) * (10 i)Next iCase 44N = Len(Text2.Text)For i = N - 1 To 0 Step -1If b = 10 i

    16、 Thenf(i) = 1Elsef(i) = 0End IfIf f(i) = 0 Thene = dElseIf f(i) = 1 And d = 0 Thene = 1ElseIf f(i) = 1 And d = 1 Thene = 0End If: End If: End If: Print ed = e: b = b - f(i) * (10 i)Next iCase 12If IsNumeric(Text3.Text) = False Then MsgBox 输入有误: Text3.Text = : Text3.SetFocus: Exit Sub End If If IsNum

    17、eric(Text5.Text) = False Then MsgBox 输入有误: Text5.Text = : Text5.SetFocus: Exit Sub End IfN = Len(Text2.Text)For i = N - 1 To 0 Step -1If b = 10 i Thenf(i) = 1Elsef(i) = 0End IfIf c = 10 i Theng(i) = 1Elseg(i) = 0End IfIf f(i) = 0 And g(i) = 0 Thenj(i) = dElseIf f(i) = 0 And g(i) = 1 Thenj(i) = 0Else

    18、If f(i) = 1 And g(i) = 0 Thenj(i) = 1ElseIf f(i) = 1 And g(i) = 1 ThenMsgBox 不允许End If: End If: End If: End Ifb = b - f(i) * (10 i): c = c - g(i) * (10 i): k(i) = 1 - j(i)If j(i) = 0 Thene = 0Elsee = 1End IfPrint ed = eNext iCase 13If IsNumeric(Text3.Text) = False Then MsgBox 输入有误: Text3.Text = : Te

    19、xt3.SetFocus: Exit Sub End If If IsNumeric(Text5.Text) = False Then MsgBox 输入有误: Text5.Text = : Text5.SetFocus: Exit Sub End IfN = Len(Text2.Text)For i = N - 1 To 0 Step -1If b = 10 i Thenf(i) = 1Elsef(i) = 0End IfIf c = 10 i Theng(i) = 1Elseg(i) = 0End IfIf f(i) = 0 And g(i) = 0 Thenj(i) = dElseIf

    20、f(i) = 0 And g(i) = 1 Thenj(i) = 0ElseIf f(i) = 1 And g(i) = 0 Thenj(i) = 1ElseIf f(i) = 1 And g(i) = 1 ThenMsgBox 不允许: Exit SubEnd If: End If: End If: End Ifb = b - f(i) * (10 i): c = c - g(i) * (10 i): e = j(i)Print ed = eNext iCase 14If IsNumeric(Text3.Text) = False Then MsgBox 输入有误: Text3.Text =

    21、 : Text3.SetFocus: Exit Sub End If If IsNumeric(Text5.Text) = False Then MsgBox 输入有误: Text5.Text = : Text5.SetFocus: Exit Sub End IfN = Len(Text2.Text)For i = N - 1 To 0 Step -1If b = 10 i Thenf(i) = 1Elsef(i) = 0End IfIf c = 10 i Theng(i) = 1Elseg(i) = 0End IfIf f(i) = 0 And g(i) = 0 Thenj(i) = dEl

    22、seIf f(i) = 0 And g(i) = 1 Thenj(i) = 0ElseIf f(i) = 1 And g(i) = 0 Thenj(i) = 1ElseIf f(i) = 1 And g(i) = 1 ThenMsgBox 不允许: Exit SubEnd If: End If: End If: End Ifb = b - f(i) * (10 i): c = c - g(i) * (10 i): d = j(i)If j(i) = 0 Thene = rElseIf j(i) = 1 And r = 0 Thene = 1ElseIf j(i) = 1 And r = 1 T

    23、hene = 0End If: End If: End If: Print er = eNext iCase 23If IsNumeric(Text3.Text) = False Then MsgBox 输入有误: Text3.Text = : Text3.SetFocus: Exit Sub End If If IsNumeric(Text5.Text) = False Then MsgBox 输入有误: Text5.Text = : Text5.SetFocus: Exit Sub End IfN = Len(Text2.Text)For i = N - 1 To 0 Step -1If

    24、b = 10 i Thenf(i) = 1Elsef(i) = 0End IfIf c = 10 i Theng(i) = 1Elseg(i) = 0End IfIf f(i) = 0 And g(i) = 0 Thenj(i) = dElseIf f(i) = 0 And g(i) = 1 Thenj(i) = 0ElseIf f(i) = 1 And g(i) = 0 Thenj(i) = 1ElseIf f(i) = 1 And g(i) = 1 And d = 0 Thenj(i) = 1ElseIf f(i) = 1 And g(i) = 1 And d = 1 Thenj(i) =

    25、 0End If: End If: End If: End If: End Ifb = b - f(i) * (10 i): c = c - g(i) * (10 i): e = j(i)Print ed = eNext iCase 24If IsNumeric(Text3.Text) = False Then MsgBox 输入有误: Text3.Text = : Text3.SetFocus: Exit Sub End If If IsNumeric(Text5.Text) = False Then MsgBox 输入有误: Text5.Text = : Text5.SetFocus: E

    26、xit Sub End IfN = Len(Text2.Text)For i = N - 1 To 0 Step -1If b = 10 i Thenf(i) = 1Elsef(i) = 0End IfIf c = 10 i Theng(i) = 1Elseg(i) = 0End IfIf f(i) = 0 And g(i) = 0 Thenj(i) = dElseIf f(i) = 0 And g(i) = 1 Thenj(i) = 0ElseIf f(i) = 1 And g(i) = 0 Thenj(i) = 1ElseIf f(i) = 1 And g(i) = 1 And d = 0

    27、 Thenj(i) = 1ElseIf f(i) = 1 And g(i) = 1 And d = 1 Thenj(i) = 0End If: End If: End If: End If: End Ifd = j(i): b = b - f(i) * (10 i): c = c - g(i) * (10 i)If j(i) = 0 Thene = rElseIf j(i) = 1 And r = 0 Thene = 1ElseIf j(i) = 1 And r = 1 Thene = 0End If: End If: End If: Print er = eNext iCase 34 If

    28、IsNumeric(Text5.Text) = False Then MsgBox 输入有误: Text5.Text = : Text5.SetFocus: Exit Sub End IfN = Len(Text2.Text)For i = N - 1 To 0 Step -1If b = 10 i Thenf(i) = 1Elsef(i) = 0End IfIf f(i) = 0 Thene = rElseIf f(i) = 1 And r = 0 Thene = 1ElseIf f(i) = 1 And r = 1 Thene = 0End If: End If: End Ifb = b

    29、- f(i) * (10 i)Print er = eNext i: End Select: End SubPrivate Sub Text1_Click()Text1.Text = : End SubPrivate Sub Text1_KeyPress(KeyAscii As Integer)If KeyAscii 57 Then KeyAscii = 0 只能输入数字End SubPrivate Sub Text2_click()Text2.Text = : End SubPrivate Sub Text2_KeyPress(KeyAscii As Integer)If KeyAscii 49 Then KeyAscii = 0 只能输入0或1End SubPrivate


    注意事项

    本文(触发器代码.docx)为本站会员主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

    copyright@ 2008-2023 冰点文库 网站版权所有

    经营许可证编号:鄂ICP备19020893号-2


    收起
    展开