Click here to Skip to main content
15,902,114 members
Home / Discussions / C#
   

C#

 
GeneralRe: Run Multiple Forms Pin
Not Active22-Aug-11 2:14
mentorNot Active22-Aug-11 2:14 
GeneralRe: Run Multiple Forms Pin
share_holder22-Aug-11 21:16
share_holder22-Aug-11 21:16 
AnswerRe: Run Multiple Forms [modified] Pin
BillWoodruff22-Aug-11 3:17
professionalBillWoodruff22-Aug-11 3:17 
GeneralRe: Run Multiple Forms Pin
share_holder22-Aug-11 21:15
share_holder22-Aug-11 21:15 
GeneralRe: Run Multiple Forms Pin
BillWoodruff22-Aug-11 21:28
professionalBillWoodruff22-Aug-11 21:28 
GeneralRe: Run Multiple Forms Pin
share_holder22-Aug-11 21:33
share_holder22-Aug-11 21:33 
GeneralRe: Run Multiple Forms Pin
share_holder23-Aug-11 1:39
share_holder23-Aug-11 1:39 
Questiontwo use-cases that do not (surprise) cause a compiler error in VS 2010 Pro Pin
BillWoodruff21-Aug-11 22:28
professionalBillWoodruff21-Aug-11 22:28 
1. a function that returns any type of object can be called without using the result:
private string whale(string theSpeciesOfWhale)
{
  return theSpeciesOfWhale + " is a whale";
}

private void someMethod()
{
// no compile error
whale("Baleen");
}
2. You can add a new Class to a Project, remove the NameSpace declaration added by VS, and in it define classes, dynamic, or static: you can then access these classes from anywhere else in your Project directly:
C#
using System;

public class anyClass
{
    public int someInt;
}
At first, I thought perhaps there was an 'implicit default' NameSpace based on the Assembly name, but trying to access a class defined in a no-NameSpace form by using the Assembly name + dot + class name: does not work.

Both of these use-cases were just 'stumbled upon' by accident, and somehow they seem, to me, to be not 'congruent' with the strongly typed nature of C#.

In the case of allowing a function to be called, and not handling its return value, I can kind of see the rationale for that: in one instance you might call said function just for a side-effect, and in another instance you might want to do something based on the value it returned. I would not want to write code that allows even a slight ambiguity of interpreted use, so, in that case, I would write two functions.

The second case just seems like a 'puzzle:' when 'anyClass is defined above, does it exist in a NameSpace ... or not ?

Well, what say you: is this another instance of my inability to perceive the glorious meta-structure of .NET and C# in Visual Studio ?

best, Bill
"In the River of Delights, Panic has not failed me." Jorge Luis Borges

AnswerRe: two use-cases that do not (surprise) cause a compiler error in VS 2010 Pro Pin
BobJanova21-Aug-11 22:49
BobJanova21-Aug-11 22:49 
AnswerRe: two use-cases that do not (surprise) cause a compiler error in VS 2010 Pro Pin
Dave Kreskowiak22-Aug-11 2:07
mveDave Kreskowiak22-Aug-11 2:07 
GeneralRe: two use-cases that do not (surprise) cause a compiler error in VS 2010 Pro Pin
BillWoodruff22-Aug-11 3:28
professionalBillWoodruff22-Aug-11 3:28 
GeneralRe: two use-cases that do not (surprise) cause a compiler error in VS 2010 Pro Pin
Dave Kreskowiak22-Aug-11 4:10
mveDave Kreskowiak22-Aug-11 4:10 
GeneralRe: two use-cases that do not (surprise) cause a compiler error in VS 2010 Pro Pin
Shameel22-Aug-11 4:22
professionalShameel22-Aug-11 4:22 
GeneralRe: two use-cases that do not (surprise) cause a compiler error in VS 2010 Pro Pin
Dave Kreskowiak22-Aug-11 5:57
mveDave Kreskowiak22-Aug-11 5:57 
AnswerRe: two use-cases that do not (surprise) cause a compiler error in VS 2010 Pro Pin
PIEBALDconsult22-Aug-11 2:45
mvePIEBALDconsult22-Aug-11 2:45 
AnswerRe: two use-cases that do not (surprise) cause a compiler error in VS 2010 Pro PinPopular
Luc Pattyn22-Aug-11 3:09
sitebuilderLuc Pattyn22-Aug-11 3:09 
GeneralRe: two use-cases that do not (surprise) cause a compiler error in VS 2010 Pro Pin
Shameel22-Aug-11 4:52
professionalShameel22-Aug-11 4:52 
AnswerRe: two use-cases that do not (surprise) cause a compiler error in VS 2010 Pro Pin
Shameel22-Aug-11 4:27
professionalShameel22-Aug-11 4:27 
Questionwindow services in VS2008 [modified] Pin
Aisha sharma21-Aug-11 21:12
Aisha sharma21-Aug-11 21:12 
AnswerRe: window services in VS2008 Pin
Richard MacCutchan21-Aug-11 21:38
mveRichard MacCutchan21-Aug-11 21:38 
AnswerRe: window services in VS2008 Pin
Paul E Davies21-Aug-11 22:07
Paul E Davies21-Aug-11 22:07 
GeneralRe: window services in VS2008 Pin
Aisha sharma22-Aug-11 0:29
Aisha sharma22-Aug-11 0:29 
GeneralRe: window services in VS2008 [modified] Pin
Paul E Davies22-Aug-11 2:56
Paul E Davies22-Aug-11 2:56 
QuestionXML to Excel parsing Pin
yoni.kess21-Aug-11 4:15
yoni.kess21-Aug-11 4:15 
AnswerRe: XML to Excel parsing Pin
Not Active21-Aug-11 6:47
mentorNot Active21-Aug-11 6:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.