Click here to Skip to main content
16,004,507 members
Home / Discussions / C#
   

C#

 
AnswerRe: programming Event Logic Pin
MicroVirus27-Aug-11 5:58
MicroVirus27-Aug-11 5:58 
AnswerRe: programming Event Logic Pin
GParkings1-Sep-11 6:55
GParkings1-Sep-11 6:55 
QuestionIs there a use for... [modified] Pin
Narf the Mouse26-Aug-11 14:39
Narf the Mouse26-Aug-11 14:39 
AnswerRe: Is there a use for... Pin
PIEBALDconsult26-Aug-11 14:46
mvePIEBALDconsult26-Aug-11 14:46 
GeneralRe: Is there a use for... Pin
Narf the Mouse26-Aug-11 15:05
Narf the Mouse26-Aug-11 15:05 
AnswerRe: Is there a use for... Pin
Narf the Mouse26-Aug-11 15:18
Narf the Mouse26-Aug-11 15:18 
GeneralRe: Is there a use for... Pin
BillWoodruff27-Aug-11 18:16
professionalBillWoodruff27-Aug-11 18:16 
GeneralRe: Is there a use for... Pin
Narf the Mouse27-Aug-11 19:36
Narf the Mouse27-Aug-11 19:36 
Essentially? Adds the numbers 0 to 10 to the functions' arguments. The function then iterates through those arguments and constructs a comma-separated string.

"Call" is a general property that returns "Whatever it is the object does/is". In the case of the function, it calls the function. In the case of DTArgs, it dequeues the next argument.

In comment-o-vision:
C#
// So, create a new function taking DTArgs<double> as input,
// which is in short a queue of doubles (or anything else we want)
// The first type, in this case "double", is the type used by
// the function's internal DTArgs<T>.
DTFunc<double, string> f = new DTFunc<double, string>(
    a =>
    {
        // The function body.
        string r = "";
        // While our DTArgs<double> 'a' has values,
        while (a.Count > 0)
        {
            // Add the next argument to the string, followed by a comma.
            // a.Call dequeues and returns the next argument.
            r += a.Call + ", ";
        }
        // Chop off the last comma.
        return r.Length > 0 ? r.Substring(0, r.Length - 2) : r;
    }
);

// The function needs arguments,
for (int i = 0; i <= 10; ++i)
    // So add them. Granted, setting a property is not standard.
    // But, this code is in my "StrangeTest" project.
    // .Args is a property accessor to the functions' DTArgs.
    f.Args.Add = i;

// Call the function and write the output to the console.
Console.WriteLine(f.Call);


I have no idea how well I'm explaining things (which tends to make my explanations rather...Bad), but hopefully I've cleared up at least a little confusion. Smile | :)
AnswerRe: Is there a use for... Pin
jschell28-Aug-11 8:03
jschell28-Aug-11 8:03 
GeneralRe: Is there a use for... Pin
Narf the Mouse28-Aug-11 8:56
Narf the Mouse28-Aug-11 8:56 
AnswerRe: Is there a use for... Pin
Narf the Mouse28-Aug-11 11:33
Narf the Mouse28-Aug-11 11:33 
GeneralRe: Is there a use for... [modified] Pin
BillWoodruff28-Aug-11 19:37
professionalBillWoodruff28-Aug-11 19:37 
AnswerRe: Is there a use for... Pin
BobJanova30-Aug-11 0:20
BobJanova30-Aug-11 0:20 
GeneralRe: Is there a use for... Pin
Narf the Mouse30-Aug-11 0:38
Narf the Mouse30-Aug-11 0:38 
GeneralRe: Is there a use for... Pin
BobJanova30-Aug-11 6:52
BobJanova30-Aug-11 6:52 
AnswerRe: Is there a use for... Pin
GParkings1-Sep-11 7:04
GParkings1-Sep-11 7:04 
GeneralRe: Is there a use for... Pin
Narf the Mouse1-Sep-11 7:16
Narf the Mouse1-Sep-11 7:16 
GeneralRe: Is there a use for... Pin
GParkings1-Sep-11 7:23
GParkings1-Sep-11 7:23 
GeneralRe: Is there a use for... Pin
Narf the Mouse1-Sep-11 8:26
Narf the Mouse1-Sep-11 8:26 
QuestionInheritance Pin
lukeer26-Aug-11 3:47
lukeer26-Aug-11 3:47 
AnswerRe: Inheritance Pin
Rob Philpott26-Aug-11 3:55
Rob Philpott26-Aug-11 3:55 
AnswerRe: Inheritance Pin
MicroVirus26-Aug-11 4:17
MicroVirus26-Aug-11 4:17 
GeneralMessage Removed Pin
26-Aug-11 5:40
mentorNot Active26-Aug-11 5:40 
GeneralRe: Inheritance Pin
MicroVirus26-Aug-11 6:09
MicroVirus26-Aug-11 6:09 
GeneralMessage Removed Pin
26-Aug-11 7:10
mentorNot Active26-Aug-11 7:10 

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.