- Code: Select all
return_value = msgbox ( "Do you want a hint?", vbYesNo + vbQuestion, "HINT?")
if return_value = vbOK then msgbox "You have clicked OK. Here is the hint..."
And if you look it is telling you to use OK in the if return_value = vbOK and it should be If return_value = vbYes.
The following example shows how to ask the player if he wants a hint and then give it to him he clicked "OK":
return_value = msgbox ( "Do you want a hint?", vbYesNo + vbQuestion, "HINT?")
if return_value = vbOK then msgbox "You have clicked OK. Here is the hint..."
It should look like this.
return_value = MsgBox ( "Do you want a hint?", vbYesNo + vbQuestion, "HINT?")
If return_value = vbYes then MsgBox "You have clicked Yes. Here is the hint..."
Hope that helps.
Here is how it looks if they click No.
- Code: Select all
return_value = MsgBox ( "Do you want a hint?", vbYesNo + vbQuestion, "HINT?")
If return_value = vbYes then MsgBox "You have clicked Yes. Here is the hint..."
If return_value = vbNo then MsgBox "You have clicked No. No hint..."