is this a bug or am i crazy? 
Author Message
 is this a bug or am i crazy?

Hi,

I'm using VB 5.0 Professional and I have the following code segment:

---- start ----
Public Sub SetAttribute(ByVal AttribID As String, _
    ByVal inLevel As Integer)
    Dim newattrib As Attribute

End Sub
---- end -----

The type "Attribute" has been defined and the class is part of my project.
In fact, "Attribute" shows up on the pop-up list as I'm typing it out. But
when I hit "Enter", I get "Compile Error: Expected: New or type name".
Yes, it's spelled correctly.

On a lark, I replaced "Attribute" with "blahblahblah" in the code segment
above, and I got no error. What the hell is going on here? Is the name
"Attribute" getting confused with some other reserved word in VB5? Or is
my computer having an attack of the crazies? Or is this a genuine bug in
VB5?

TIA,

James



Fri, 25 Aug 2000 03:00:00 GMT  
 is this a bug or am i crazy?

James,
    The compiler may be getting confused with the Attributes property.  VB
does some crazy things and I've found it best to alway stay away from any
name used as a property, method, event, etc.  This will also give people
reading your code a better understand of what the program is doing.  Below
is what Attributes does according to VB:
Sets or returns a value that indicates one or more characteristics of a
Field, Relation, or TableDef object.

Settings and Return Values

The setting or return value is Long data type, and the default value is 0.
For a Field object, the value specifies characteristics of the field
represented by the Field object and can be a combination of these constants.

Hope it helped.
Mark

Quote:

>Hi,

>I'm using VB 5.0 Professional and I have the following code segment:

>---- start ----
>Public Sub SetAttribute(ByVal AttribID As String, _
>    ByVal inLevel As Integer)
>    Dim newattrib As Attribute

>End Sub
>---- end -----

>The type "Attribute" has been defined and the class is part of my project.
>In fact, "Attribute" shows up on the pop-up list as I'm typing it out. But
>when I hit "Enter", I get "Compile Error: Expected: New or type name".
>Yes, it's spelled correctly.

>On a lark, I replaced "Attribute" with "blahblahblah" in the code segment
>above, and I got no error. What the hell is going on here? Is the name
>"Attribute" getting confused with some other reserved word in VB5? Or is
>my computer having an attack of the crazies? Or is this a genuine bug in
>VB5?

>TIA,

>James



Fri, 25 Aug 2000 03:00:00 GMT  
 is this a bug or am i crazy?


Quote:
>I'm using VB 5.0 Professional and I have the following code segment:

>---- start ----
>Public Sub SetAttribute(ByVal AttribID As String, _
>    ByVal inLevel As Integer)
>    Dim newattrib As Attribute

>End Sub
>---- end -----

>The type "Attribute" has been defined and the class is part of my project.
>In fact, "Attribute" shows up on the pop-up list as I'm typing it out. But
>when I hit "Enter", I get "Compile Error: Expected: New or type name".
>Yes, it's spelled correctly.

>On a lark, I replaced "Attribute" with "blahblahblah" in the code segment
>above, and I got no error. What the hell is going on here? Is the name
>"Attribute" getting confused with some other reserved word in VB5? Or is
>my computer having an attack of the crazies? Or is this a genuine bug in
>VB5?

I would think that Attribute is a reserved word. And if you don't have
"Option Explicit" in the module, that would explain why "blahblahblah"
isn't causing any errors.

--Adina Adler               (you should be able to
 a a d l e r AT              figure out how to fix
 g l o b a l r e c a l l     this to reply)
 DOT c o m
No matter how good your market research may be, I assure you that I am
not interested in your product. Don't add me to your mailing list and
don't ask me to "simply reply to remove myself". Just leave me alone.



Fri, 25 Aug 2000 03:00:00 GMT  
 is this a bug or am i crazy?



Quote:
>The type "Attribute" has been defined and the class is part of my project.

Test: rename your class to some other name (e.g. CAttribute), and try again.

DoDi



Sat, 02 Sep 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. HELP!!! Cmd.CreateParameter I am getting crazy

2. 50 users running Access, am I crazy.

3. ** HELP WITH vb 4.0 I am going crazy**

4. Overflow - Am I going crazy?

5. Am I crazy, or is the Timer control?

6. Am I crazy or what?

7. I am trying to update a record, i am not using data control

8. I am learning VB.NET and am wondering....

9. I am trying to update a record, i am not using data control

10. MDI-problem-am i stupid or is it a bug -2 icons in menubar

11. Bug in D3DXQuaternionRotationMatrix - or am I stupid?

12. When is 5:00 AM not 5:00 AM? When it's 5:00 AM.

 

 
Powered by phpBB® Forum Software