All the .Net languages use the Common Language Runtime (CLR). C# will expose
the CLR to you in ways that is different from other .Net languages. As you
mentioned the word [string] is presented in blue and is a keyword in c#. It
equates to the [System.String] type. There is no keyword decimal in C#.
There is the [System.Decimal] structure in the System namespace. It defines
the Decimal Value Type as:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Decimal value type represents decimal numbers ranging from positive
79,228,162,514,264,337,593,543,950,335 to negative
79,228,162,514,264,337,593,543,950,335. The Decimal value type is
appropriate for financial calculations requiring large numbers of
significant integral and fractional digits and no round-off errors.
A decimal number is a signed, fixed-point value consisting of an integral
part and an optional fractional part. The integral and fractional parts
consist of a series of digits that range from zero to nine (0 to 9),
separated by a decimal point symbol.
The binary representation of an instance of Decimal consists of a 1-bit
sign, a 96-bit integer number, and a scaling factor used to divide the
96-bit integer and specify what portion of it is a decimal fraction. The
scaling factor is implicitly the number 10, raised to an exponent ranging
from 0 to 28.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
My guess is that you are probably wanting to use the keyword [single] or
[double] which represent single or double precision floating point numbers.
These equate to System.Single and System.Double respectively.
"MDoyle" <MDoyle.1qkhla@> wrote in message
news:sI********************@giganews.com...
Here is the easiest question you'll get all day from a complete newbie.
I installed Visual Studio on my laptop last night and have been trying
to write my very first C# programs this morning. I'm running into a
few issues that I'm sure someone on this forum will be able to help me
understand quickly.
I started out with a traditional "Hello World" program, again, my first
C# programs. I was surprised to see how the System namespace was
referenced in the code that was generated by the IDE. In addition, it
looks like the IDE generates code that explicitly referenced items from
the System namespace using a notation that looks something like
"System::item". I haven't seen this in any of the C# books that I've
referenced. Each of these books suggests that you simply need to issue
a "using System;" and I should be able to reference any item from the
System namespace.
I then tried to create a variable of value type "decimal". It looks to
me like "decimal" should be defined in the System namespace. The first
thing I noticed was that the IDE did not color the keyword "decimal" in
blue like it did for the other value types I had used (i.e. int, string,
etc.). Sure enough, when I tried to compile the program, the complier
didn't recognize the keyword "decimal".
I'm sure that these issues are all related somehow. Can someone direct
me to some additional information that would help be figure out what I'm
doing wrong here so I can get through my first few C# programs?
--
MDoylePosted from http://www.pcreview.co.uk/ newsgroup access