Re: Convert Delphi to C#
- From: C# Learner <csharp@xxxxxxxxxxxx>
- Date: Wed, 8 Jun 2005 21:42:27 +0100
Kostya Ergin <kostya@xxxxxxxxxxxxx> wrote:
> This is function:
> function test(param: string): string;
> begin
> end;
>
> I can get result of "test" function:
> result := test(param);
>
> And how to do in C# ?
The closest you can get to a Delphi function in C# would be a non-void
static method:
static string test(string param) {
// this won't compile since this method is non-void and no value is
// returned, and that's not valid C#
}
FWIW, C# static methods are pretty much the same as Delphi class methods.
Therefore, the above is pretty much the same as:
class function InsertClassNameHere.test(param: string): string;
begin
end;
.
- References:
- Convert Delphi to C#
- From: Kostya Ergin
- Convert Delphi to C#
- Prev by Date: Getting at variant containing safe array from COM object?
- Next by Date: Re: Getting at variant containing safe array from COM object?
- Previous by thread: Re: Convert Delphi to C#
- Next by thread: VC# Express Beta 2 - Multithreaded debugging
- Index(es):
Relevant Pages
|