Click here to Skip to main content
15,890,186 members
Home / Discussions / C#
   

C#

 
GeneralRe: Automating MS Office97/2000/XP with same C# Code Pin
James T. Johnson30-Dec-01 19:59
James T. Johnson30-Dec-01 19:59 
GeneralRe: Automating MS Office97/2000/XP with same C# Code Pin
Peter Tewkesbury2-Jan-02 5:49
professionalPeter Tewkesbury2-Jan-02 5:49 
GeneralWriting a custom Grid control and need help coding the scrolling events Pin
hsd28-Dec-01 10:01
hsd28-Dec-01 10:01 
GeneralRe: Writing a custom Grid control and need help coding the scrolling events Pin
James T. Johnson30-Dec-01 20:16
James T. Johnson30-Dec-01 20:16 
GeneralRe: Writing a custom Grid control and need help coding the scrolling events Pin
James T. Johnson31-Dec-01 20:02
James T. Johnson31-Dec-01 20:02 
GeneralFunction Pin
26-Dec-01 16:32
suss26-Dec-01 16:32 
GeneralRe: Function Pin
Christian Graus26-Dec-01 16:50
protectorChristian Graus26-Dec-01 16:50 
GeneralRe: Function Pin
Andreas Philipson26-Dec-01 23:18
Andreas Philipson26-Dec-01 23:18 
You could also use the out keyword.
public bool OurFunction (out object value2)
{
   bool value; //return value;

   //do whatever...

   if (value)
      value2 = "This object returned true!!!";
   else
      value2 = new string [] {"This object", "returned", "true", "!!!"};

   return value;
}



Or you could simply just return an object and then check the type wheter it's true of false...
public object OurFunction2 ()
{
   bool value;
   object value2;

   // do whatever...

  if (value)
      value2 = "This object returned true!!!";
   else
      value2 = new string [] {"This object", "returned", "true", "!!!"};

   return value2;
}

public void MainFunction ()
{
   object obj = this.OurFunction2 ();
   if (obj.GetType () == typeof (string)) //true
      Console.WriteLine ("TRUE!!!")
   else // false...
      Console.WriteLine ("FALSE!!!");
}

Smile | :)

Andreas Philipson
GeneralRe: Function Pin
Eric Gunnerson (msft)2-Jan-02 8:59
Eric Gunnerson (msft)2-Jan-02 8:59 
QuestionUsing Fixed Width Fonts like FixedSys, Howto? Pin
fadi26-Dec-01 10:15
fadi26-Dec-01 10:15 
QuestionRegEx question How to string match to New String? Pin
25-Dec-01 20:46
suss25-Dec-01 20:46 
AnswerRe: RegEx question How to string match to New String? Pin
Eric Gunnerson (msft)2-Jan-02 8:58
Eric Gunnerson (msft)2-Jan-02 8:58 
QuestionWhat can C# handle? Pin
25-Dec-01 16:58
suss25-Dec-01 16:58 
AnswerRe: What can C# handle? Pin
Nish Nishant25-Dec-01 17:10
sitebuilderNish Nishant25-Dec-01 17:10 
GeneralRemoting in Win 9x/Me Pin
RIPPER_X23-Dec-01 11:50
RIPPER_X23-Dec-01 11:50 
GeneralEvents Pin
Senkwe Chanda23-Dec-01 4:35
Senkwe Chanda23-Dec-01 4:35 
GeneralRe: Events Pin
Andreas Philipson25-Dec-01 4:28
Andreas Philipson25-Dec-01 4:28 
GeneralRe: Events Pin
ector20-Feb-02 9:51
ector20-Feb-02 9:51 
GeneralExcel COM... Pin
Andreas Philipson20-Dec-01 3:24
Andreas Philipson20-Dec-01 3:24 
GeneralRe: Excel COM... Pin
Eric Gunnerson (msft)2-Jan-02 8:56
Eric Gunnerson (msft)2-Jan-02 8:56 
GeneralRe: Using a managed C++ class library from within C# Pin
Nemanja Trifunovic19-Dec-01 6:16
Nemanja Trifunovic19-Dec-01 6:16 
Questional.exe and csc.exe - where to find them? Pin
C. Kapturek18-Dec-01 21:45
C. Kapturek18-Dec-01 21:45 
AnswerRe: al.exe and csc.exe - where to find them? Pin
Nish Nishant18-Dec-01 22:15
sitebuilderNish Nishant18-Dec-01 22:15 
GeneralRe: al.exe and csc.exe - where to find them? Pin
C. Kapturek18-Dec-01 22:35
C. Kapturek18-Dec-01 22:35 
GeneralClient code in C++ and Server in C# Pin
Vivek Kumar18-Dec-01 17:53
Vivek Kumar18-Dec-01 17:53 

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.