标题:VB_模拟实现简单的中断
只看楼主
lanshanlhy
Rank: 1
等 级:新手上路
帖 子:130
专家分:0
注 册:2006-4-16
结帖率:33.33%
 问题点数:0 回复次数:2 
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
BEARBEN
Rank: 1
等 级:新手上路
帖 子:114
专家分:0
注 册:2007-7-7
得分:0 
。。。。。CPUInterrupt。。。。
我还以为楼主真放出终止CPU的代码。。。。

2007-08-30 09:22
multiple19O2
Rank: 1
等 级:新手上路
帖 子:326
专家分:0
注 册:2007-8-29
得分:0 
可以了  原理明白了
2007-08-30 10:32



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




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

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