Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


property in delphi

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
MadDoom
Cheater
Reputation: 0

Joined: 27 Dec 2006
Posts: 38

PostPosted: Wed Jul 11, 2007 5:13 am    Post subject: property in delphi Reply with quote

ok, i know that i can add a new property to some class, but how i do it?
here is the code that i wrote:
Code:
unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm2 = class(TForm)
    Edit1: TEdit;
    procedure Edit1Change(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
type
   TCompass = class(TControl)
     private
        FHeading: string;
        procedure SetHeading(Value: string);
     published
        property Heading: string read FHeading write SetHeading;

    end;
var
  Form2: TForm2;

implementation

procedure TCompass.SetHeading(Value: string);
begin
            if FHeading <> Value then
             begin
               FHeading := value;
               Repaint;    // update user interface to reflect new value
             end;
end;
{$R *.dfm}

procedure TForm2.Edit1Change(Sender: TObject);
var s,l:TCompass;
begin
s.heading:='7';
edit1.Text:=s.fheading;
end;

end.

y cant i change the property?!?! Crying or Very sad
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25814
Location: The netherlands

PostPosted: Wed Jul 11, 2007 5:21 am    Post subject: Reply with quote

TCompass is a class
You're forgetting to allocate (create) it

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites