![]() |
Inttostr int C#
Hallo zusammen,
wie heißt denn inttostr bei c# ???? zum beispiel ... { int a; a = 2 ; label1.text = a } : geht ja nicht |
Re: Inttostr int C#
In .NET ist der Integer selbst eine Klasse... Umwandlung geht z.B. a.ToString
|
Re: Inttostr int C#
so^^?
{ int a; a = 2; textBox1.Text = a.ToString; } nur bei mir ging des nicht :( |
Re: Inttostr int C#
also ich muss zugeben das ich kaum Ahnung von .NET hab aber bei mir geht (zumindest in VB .NET)
Code:
cstr(Integer)
|
Re: Inttostr int C#
@Neutral General: Ieeeks :duck:
@Kuh am Schuh: C# ist bei Methoden konsequenter als Pascal, auch parameterlose Methoden benötigen ein Klammerpaar. |
Re: Inttostr int C#
Zitat:
|
Re: Inttostr int C#
Zitat:
|
Re: Inttostr int C#
Für native VB-Umsteiger ist das vielleicht noch in Ordnung, aber das kann man doch unmöglich jemandem weiterempfehlen :stupid: . Zumal diese ganzen Artefakte natürlich nur in VB.NET nutzbar sind.
|
Re: Inttostr int C#
Zitat:
|
Re: Inttostr int C#
Zitat:
Hier mal eine .NET Zeile, für die ich mich eine halbe Stunde durch das Netz schlagen musste, da die "Hilfe-Funktion" von Delphi 2005 einfach nur absolut unbrauchbar ist:
Delphi-Quellcode:
Label1.Text := Int32(Convert.ToInt32(TextBox1.Text) * Convert.ToInt32(TextBox1.Text)).ToString;
Im richtigen Delphi wäre das einfach:
Delphi-Quellcode:
Das ist nicht nur kürzer, sondern auch viel einfacher und logischer zu lesen.
Label1.Caption := IntToStr(StrToInt(Edit1.Text) * StrToInt(Edit1.Text));
Der ganze Objektorientiertheitswahn ist einfach Mist! |
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:16 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz