Welcome to Dream.In.Code
Become an Expert!

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




I want Dim shape1 As Shape!

 
Reply to this topicStart new topic

I want Dim shape1 As Shape!, VB6 confused - quick help please.

Dean Corleone
23 Jul, 2007 - 07:16 PM
Post #1

New D.I.C Head
*

Joined: 14 Jul, 2007
Posts: 16


My Contributions
Well ok for starts I am making a simple program using DirectX7 - and at the start of the program I'm trying to
Dim shape1 As Shape
but whenever I go down to the next line it "fixes" the code to
Dim shape1 As shape
I'm not sure if this matters, but I figured I'd ask now here anyways... its very annoying.

Thanks.
User is offlineProfile CardPM
+Quote Post

girasquid
RE: I Want Dim Shape1 As Shape!
23 Jul, 2007 - 08:09 PM
Post #2

Barbarbar
Group Icon

Joined: 3 Oct, 2006
Posts: 1,294



Thanked: 18 times
Dream Kudos: 725
My Contributions
I'm pretty sure it's just fixing a typo of yours. Maybe the 'Shape' type is actually supposed to be 'shape'.
User is online!Profile CardPM
+Quote Post

Dean Corleone
RE: I Want Dim Shape1 As Shape!
23 Jul, 2007 - 10:51 PM
Post #3

New D.I.C Head
*

Joined: 14 Jul, 2007
Posts: 16


My Contributions
QUOTE(girasquid @ 23 Jul, 2007 - 09:09 PM) *

I'm pretty sure it's just fixing a typo of yours. Maybe the 'Shape' type is actually supposed to be 'shape'.


I went and looked at the source code which came with the chapter in the book - and they have it listed as
Dim shape1 As Shape
so I redid my project - started a new! I just wanted to see if it would 'fix the typo' I was having and convert it back to shape again, rather then stay on Shape like I wanted - and it didn't, stayed as Shape... right now it doesn't
matter what happened and it might be covered in later chapters as how to
avoid small errors like this - but I wouldn't mind knowing why it would change my entry from
Dim shape1 As Shape
to
Dim shape1 as shape
the second I went tot he next line...?

Thanks in advance.

This post has been edited by Dean Corleone: 23 Jul, 2007 - 10:52 PM
User is offlineProfile CardPM
+Quote Post

serializer
RE: I Want Dim Shape1 As Shape!
24 Jul, 2007 - 07:51 AM
Post #4

D.I.C Head
**

Joined: 25 Jun, 2007
Posts: 108


My Contributions
It could be that when you create the class "shape" you spelt it in lower case.

VB's automatic recasing of variables/types can be a bit weird sometimes. Once it gets it into its head that a particular token should be lower case, there's not a lot you can do!

If you post a complete listing of your code, I might be able to identify a line elsewhere that's triggering it.

As long as the code compiles and runs, it shouldn't be a problem; however it always helps to understand why something is happening, even if it's not crucial.

--serializer

User is offlineProfile CardPM
+Quote Post

Dean Corleone
RE: I Want Dim Shape1 As Shape!
24 Jul, 2007 - 04:06 PM
Post #5

New D.I.C Head
*

Joined: 14 Jul, 2007
Posts: 16


My Contributions
QUOTE(serializer @ 24 Jul, 2007 - 08:51 AM) *

It could be that when you create the class "shape" you spelt it in lower case.

VB's automatic recasing of variables/types can be a bit weird sometimes. Once it gets it into its head that a particular token should be lower case, there's not a lot you can do!

If you post a complete listing of your code, I might be able to identify a line elsewhere that's triggering it.

As long as the code compiles and runs, it shouldn't be a problem; however it always helps to understand why something is happening, even if it's not crucial.

--serializer


Yup yup which is why I posted... didn't seem critical at the time but still I WANNA know. smile.gif

I went back into the program and found the problems from looking closely... I even forget little things like...
shape1.Top = Form.ScaleWidth - shape1.Width - 1 ... it shoulda been
shape1.Top = Form1.ScaleWidth - shape1.Width - 1 ... ah well atleast I'm realizin' that I gotta slow down and stop writing CRAP code... Heh.
User is offlineProfile CardPM
+Quote Post

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

Be Social

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

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month