Welcome to Dream.In.Code
Become a VB Expert!

Join 149,928 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,857 people online right now. Registration is fast and FREE... Join Now!




MsgBox Problem

 
Reply to this topicStart new topic

MsgBox Problem, A MsgBox is being read as an array...

PheenixTears420
13 Jan, 2008 - 05:29 PM
Post #1

New D.I.C Head
*

Joined: 13 Jan, 2008
Posts: 1

Hello,

I am making a replica of the game frogger in VB6 and I have reached a snag. When the frog dies 3 times, I have coded a message box to pop up and announce game over. I have coded the message box like this:

CODE
   intGameOver = MsgBox("GAME OVER!", vbOKOnly, "Game Over")


This code returns the following error:

"Compile Error: Expected array"

Could someone please tell me what is going on here?

Thanks,

PheenixTears420
User is offlineProfile CardPM
+Quote Post

Jayman
RE: MsgBox Problem
13 Jan, 2008 - 05:43 PM
Post #2

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 7,317



Thanked: 66 times
Dream Kudos: 500
Expert In: Everything

My Contributions
What data type is intGameOver? Is it an array?
User is offlineProfile CardPM
+Quote Post

born2c0de
RE: MsgBox Problem
14 Jan, 2008 - 11:47 PM
Post #3

printf("I'm a %XR",195936478);
Group Icon

Joined: 26 Nov, 2004
Posts: 4,029



Thanked: 38 times
Dream Kudos: 2800
Expert In: 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions
That's weird.
If intGameOver was an array, the "Can't Assign to Array" error would be displayed.
User is offlineProfile CardPM
+Quote Post

Louisda16th
RE: MsgBox Problem
15 Jan, 2008 - 12:24 AM
Post #4

 101010101
Group Icon

Joined: 3 Aug, 2006
Posts: 1,812



Thanked: 1 times
Dream Kudos: 755
My Contributions
QUOTE(PheenixTears420 @ 14 Jan, 2008 - 06:59 AM) *

"Compile Error: Expected array"

Could you show some more of your code? Possibly the procedure which contains this code.
User is offlineProfile CardPM
+Quote Post

born2c0de
RE: MsgBox Problem
15 Jan, 2008 - 12:39 AM
Post #5

printf("I'm a %XR",195936478);
Group Icon

Joined: 26 Nov, 2004
Posts: 4,029



Thanked: 38 times
Dream Kudos: 2800
Expert In: 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions
You maybe looking at the wrong statement.
Perhaps another statement before the Msgbox() call is causing the error.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 03:05PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month