954,517 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Syntax error help, please? (:

Hi! So, I'm new, and I had gotten this book on how to make an RPG.

Well, as I was typing the code, it underlined some words, but at that time I didn't think anything of them, and now its being a pain. DX

Here's my code that has some problems:
Dim device As Microsoft.DirectX.Direct3D.Device
Me.Size=New Size(800, 600)
Me.Text = ("DirectX Initialization Demo")
Me.SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.Opague, True)

"Me" is being underlined in blue, and its saying its a Syntax error. How do I fix these?

I also have some other errors, such as "Declaration expected." errors, in which I have no idea what that even means. (: Please help me.

lolHANNAHH
Newbie Poster
3 posts since Jan 2009
Reputation Points: 10
Solved Threads: 0
 

Are you developing in VB.NET project?? or C# project? please send us screenshot your code should work right!

Ramy Mahrous
Postaholic
2,196 posts since Aug 2006
Reputation Points: 480
Solved Threads: 276
 

Its never actually said what language, it just said in Visual Basic. Thats the only program I'm using, and yeah..
o-o
I'm just so confused. :/ Now I'm trying to re-write my code to see if its a code mistake somewhere but as soon as I typed the "Me.Size" ect, it was underlined in blue!

lolHANNAHH
Newbie Poster
3 posts since Jan 2009
Reputation Points: 10
Solved Threads: 0
 

Okay, so, I decided to keep typing the code, and heres the code:

REM set up the presentation parameters
Dim params As New Direct3D.PresentParameters
params.Windowed=True
params.SwapEffect=Direct3D.SwapEffect.Discard
params.AutoDepthStencilFormat=Direct3D.DepthFormat.D16
params.EnabledAutoDepthStencil=True
params.BackBufferCount=1
params.BackBufferWidth=800
params.BackBufferHeight=600

all the "params", except for the very first one after Dim, is underlined in blue. It says "Declaration expected."
I don't know what that means..

lolHANNAHH
Newbie Poster
3 posts since Jan 2009
Reputation Points: 10
Solved Threads: 0
 

Where you write this code?? I think you don't write them within method!! PLEASE SEND ME SNAP SHOT OF VS SCREEN SHOWS THE ERROR. It'd help me to help you!

Ramy Mahrous
Postaholic
2,196 posts since Aug 2006
Reputation Points: 480
Solved Threads: 276
 

You need to send him what he's asking for. Frankly, if all you're doing is copying code from a book to some software it's going to be VERY difficult for you to understand what's wrong.

rapture
Posting Whiz in Training
294 posts since Jul 2007
Reputation Points: 155
Solved Threads: 41
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You