Is this a bug or am I doing something wrong? 
Author Message
 Is this a bug or am I doing something wrong?

I have a solution with two projects--Core3D and Approx.

The Core3D project has a namespace called LiquidVB.Core3D and contains a
module called modCore3D. This module defines some public constants I want to
use throughout my solution, namely PI, TWO_PI, HALF_PI, and INIFINITY.

The Approx project has a namespace called LiquidVB.Approx and contains a
class module. My problem is in this class module. When I try to reference PI
the IDE squiggles it and says "The name 'PI' is not declared."

The Approx project references Core3D and my class module imports the
LiquidVB.Core3D namespace. So why is it giving me this error? This is really
driving me nuts!

Luhar



Sun, 20 Jul 2003 01:33:46 GMT  
 Is this a bug or am I doing something wrong?
Worse case scenario, use the FQName.

LiquidVB.Core3D.modCore3D.PI

BTW, I am fairly sure that modules are not CLS compliant. Instead, you
should use a class with a private constructor to hold shared constants and
functions. Look at System.Math for an example.

--
Jonathan Allen


Quote:
> I have a solution with two projects--Core3D and Approx.

> The Core3D project has a namespace called LiquidVB.Core3D and contains a
> module called modCore3D. This module defines some public constants I want
to
> use throughout my solution, namely PI, TWO_PI, HALF_PI, and INIFINITY.

> The Approx project has a namespace called LiquidVB.Approx and contains a
> class module. My problem is in this class module. When I try to reference
PI
> the IDE squiggles it and says "The name 'PI' is not declared."

> The Approx project references Core3D and my class module imports the
> LiquidVB.Core3D namespace. So why is it giving me this error? This is
really
> driving me nuts!

> Luhar



Sun, 20 Jul 2003 01:43:19 GMT  
 Is this a bug or am I doing something wrong?
Ugh! I was afraid of that. I wanted to have some 'solution-wide' constants
defined for fast access. Isn't there a performance hit by accessing the
constants through a class? If not, or if I don't have a choice, then I guess
it doesn't matter. I can just use the ones in System.Math.

Since it's a 3D engine, I want to squeeze as much speed out of this as I
can.

Luhar


Quote:
> Worse case scenario, use the FQName.

> LiquidVB.Core3D.modCore3D.PI

> BTW, I am fairly sure that modules are not CLS compliant. Instead, you
> should use a class with a private constructor to hold shared constants and
> functions. Look at System.Math for an example.

> --
> Jonathan Allen



> > I have a solution with two projects--Core3D and Approx.

> > The Core3D project has a namespace called LiquidVB.Core3D and contains a
> > module called modCore3D. This module defines some public constants I
want
> to
> > use throughout my solution, namely PI, TWO_PI, HALF_PI, and INIFINITY.

> > The Approx project has a namespace called LiquidVB.Approx and contains a
> > class module. My problem is in this class module. When I try to
reference
> PI
> > the IDE squiggles it and says "The name 'PI' is not declared."

> > The Approx project references Core3D and my class module imports the
> > LiquidVB.Core3D namespace. So why is it giving me this error? This is
> really
> > driving me nuts!

> > Luhar



Sun, 20 Jul 2003 04:06:40 GMT  
 Is this a bug or am I doing something wrong?

Quote:
> Isn't there a performance hit by accessing the
> constants through a class?

No, they are calculated at compile time.

When you create a class like System.Math, you are effectively creating a
code module. You never actually create a "Math" object.

--
Jonathan Allen


Quote:
> Ugh! I was afraid of that. I wanted to have some 'solution-wide' constants
> defined for fast access. Isn't there a performance hit by accessing the
> constants through a class? If not, or if I don't have a choice, then I
guess
> it doesn't matter. I can just use the ones in System.Math.

> Since it's a 3D engine, I want to squeeze as much speed out of this as I
> can.

> Luhar



Sun, 20 Jul 2003 07:17:58 GMT  
 Is this a bug or am I doing something wrong?
As jonathan implies using a fully qualified name, or using imports doesn't
have any performance implications becuase at compile time they both resolve
to the same thing.

However, the scenario you describe is a bug, and you should enter it using
the form on the Beta website so MS can address the issue.  Thanks.

Omar Khan
[MSFT]


Quote:
> > Isn't there a performance hit by accessing the
> > constants through a class?

> No, they are calculated at compile time.

> When you create a class like System.Math, you are effectively creating a
> code module. You never actually create a "Math" object.

> --
> Jonathan Allen



> > Ugh! I was afraid of that. I wanted to have some 'solution-wide'
constants
> > defined for fast access. Isn't there a performance hit by accessing the
> > constants through a class? If not, or if I don't have a choice, then I
> guess
> > it doesn't matter. I can just use the ones in System.Math.

> > Since it's a 3D engine, I want to squeeze as much speed out of this as I
> > can.

> > Luhar



Mon, 21 Jul 2003 06:32:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Am I doing something wrong ?

2. Am I doing something wrong...??

3. Am I doing something wrong...??

4. Recordset: What am I doing wrong?

5. What am I doing wrong??

6. What am I doing wrong?

7. Help with syntax. What am I doing wrong

8. What am I doing wrong?

9. What am I doing wrong?

10. What am I doing wrong?

11. Please tell me what I am doing wrong - DAO parameter Append Query :(

12. What am I doing wrong? -MultiSelect List box

 

 
Powered by phpBB® Forum Software