标题:VB_模拟实现简单的中断
取消只看楼主
lanshanlhy
Rank: 1
等 级:新手上路
帖 子:130
专家分:0
注 册:2006-4-16
结帖率:33.33%
 问题点数:0 回复次数:0 
VB_模拟实现简单的中断

呵呵!今天早上看看C,发现里面有什么中断,不知道怎么回事,想了一下,就写个模拟的,代码如下:
Dim CPUinterrupt As Boolean
Dim Timerinterrupt As Boolean
Dim Transmitinterrupt As Boolean

Private Sub Interrupt()
If CPUinterrupt = True Then
Label1.Caption = "CPUinterrupt "
Exit Sub
Else
If Timerinterrupt = True Then
Label1.Caption = "Timerinterrupt "
Exit Sub
Else
If Transmitinterrupt = True Then
Label1.Caption = "Transmitinterrupt "
Exit Sub
Else
MsgBox "No Interrupt!"
Exit Sub
End If
End If
End If
End Sub

Private Sub CmdCPUinterrupt_Click()
CPUinterrupt = True
End Sub

Private Sub CmdReposition_Click()
Transmitinterrupt = False
Timerinterrupt = False
CPUinterrupt = False
End Sub

Private Sub CmdTimerinterrupt_Click()
Timerinterrupt = True
End Sub

Private Sub CmdTransmitinterrupt_Click()
Transmitinterrupt = True
End Sub
Private Sub Timer1_Timer()''''2000,2秒检测一次
Interrupt
End Sub

搜索更多相关主题的帖子: Sub Boolean CPUinterrupt Dim 模拟 
2007-08-30 09:17



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-166402-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.087757 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved