Mega Code Archive

 
Categories / Delphi / Ide Indy
 

Live Applications with Delphi++

Title: Live Applications with Delphi++ Question: Delphi++ comes in 4 dialects, thus sometimes it is confusing with the this, self, and me keywords. Answer: They are actually macros, for example: //this applies for C++ and Java++ Dialects void Button1_OnClick(any Sender) { any obj = Sender.Form.Object("Button1"); obj.Caption = "Hello"; //the same you can achieve using the this: macro this:Button1.Caption = "Hello"; } //Basic++ sub Button1_OnClick(Sender as any) me:Button1.Caption = "Hello" end sub //Pascal++ procedure Button1_OnClick(Sender: any); begin self:Button1.Caption = "Hello" end; /////////////////////////////////////////////// You can also use this. macro, for example any obj = Sender.Form; obj.Caption = "Hello"; //change the form caption //or you can this.Caption = "Hello";