[AccessD] C# automation of office

Bobby Heid bheid at sc.rr.com
Sun Jan 31 18:44:10 CST 2010


Note that the version of C# in 2010 will now support optional parameters,
supposedly because of Office interop.

Bobby


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: Sunday, January 31, 2010 10:50 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] C# automation of office

Mark,

 > (Wow, it took MSFT over 5 years to finally handle optional parameters
properly !?)

My understanding is that optional parameters are defined in the VB language
specification, whereas 
they have never been defined in the C language specification.  IOW VB had
them because (for whatever 
reason) VB defined them in the language.  This includes VB.NET AFAIK.  C did
not have them because 
they were not defined in the C language specification.  Microsoft did not
define the C language, it 
was defined long before Microsoft even existed.

Adding optional parameters to C# took some doing and are part of Microsoft's
effort to move the 
languages closer together, give each language the parts of the other
language that they never had 
before.

It has been the case since the beginning of .Net that, as Microsoft has
always said, each language 
is a valid and capable language but each language had a few things that the
other didn't.  Because 
you are familiar with VB you are aware of the VB abilities missing in C#,
but you probably are not 
aware of the C# items missing from VB.

As an example of another significant difference, VB's SELECT statement
allows you to stack cases on 
the same line:

Select case x
  Case "A", B"

This is not valid syntax in C

These kinds of things are syntactical differences and making the two
languages handle things that 
they were not originally designed to do is not necessarily a trivial task.

John W. Colby
www.ColbyConsulting.com







More information about the AccessD mailing list