Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Variables powerpoint变量_Variables_Powerpoint - Fatal编程技术网

Variables powerpoint变量

Variables powerpoint变量,variables,powerpoint,Variables,Powerpoint,我是一名教师,我在powerpoint中编写点击式游戏。 我有一张幻灯片,有3个按钮,代码有2个变量(var1和var2) 按钮3是退出(退出)按钮,仅当var1=1和var2=1 必须按正确的顺序按下按钮才能退出(按钮1后接按钮2) 我已经在模块顶部将变量声明为整数。 我的代码如下 sub button1() var1 = 1 var2 = 0 end sub sub button2() var2 = 1 end sub sub button exit() If var1.Value =

我是一名教师,我在powerpoint中编写点击式游戏。 我有一张幻灯片,有3个按钮,代码有2个变量(
var1
var2
) 按钮3是退出(退出)按钮,仅当
var1=1
var2=1
必须按正确的顺序按下按钮才能退出(按钮1后接按钮2) 我已经在模块顶部将变量声明为整数。 我的代码如下

sub button1()
var1 = 1
var2 = 0
end sub

sub button2()
var2 = 1
end sub

sub button exit()
If var1.Value = 1 & var2.Value = 1 Then
With SlideShowWindows(1).View
.GotoSlide 58, msoFalse
End With
Else
MsgBox ("incorrect combination")
End If
end sub
我不是专家,也不明白为什么这样做行不通。
请帮忙。

这应该行得通。如果没有,让我们知道哪里出了问题:

Option Explicit
' Always start with this; it forces you to 
' declare your variables properly

Dim var1 as integer
Dim var2 as integer

sub button1()
var1 = 1
var2 = 0
end sub

sub button2()
var2 = 1
end sub

sub button exit()
If var1 + var2 = 2 Then
With SlideShowWindows(1).View
.GotoSlide 58, msoFalse
End With
Else
MsgBox ("incorrect combination")
End If
end sub

没有答案,但你可能想看看。史蒂夫,这非常有效,我现在扩展了代码,包括更多的组合锁和拼图按钮。非常感谢你的帮助我非常感激。太好了。。。很高兴听到这个消息。你可能还想看看我的朋友格伦娜·肖的网站: