kiddiec
asked on
New to delphi
how do I centre text in a textedit box?
I have declared two variables in the private declaration section as follows
Private
code1:string;
code2:string
When I try to declare and set them at the same time
code1:string :='PASSWORD';
code2: string :='USERNAME'
I get an error
and when I try to use the variables elsewhere I also get errors. I have tried the help files bat cannot find anywhere that describes how and where to set the variables
I have declared two variables in the private declaration section as follows
Private
code1:string;
code2:string
When I try to declare and set them at the same time
code1:string :='PASSWORD';
code2: string :='USERNAME'
I get an error
and when I try to use the variables elsewhere I also get errors. I have tried the help files bat cannot find anywhere that describes how and where to set the variables
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
For the first question can read next tip , too .
http://www.lmc-mediaagentur.de/dpool/tips11/1096.htm
http://www.lmc-mediaagentur.de/dpool/tips11/1096.htm
ASKER
Thank you, most helpful.
I have come from a vb background and am impressed with Delphi so far, although the help files seem a bit unhelpful
I have come from a vb background and am impressed with Delphi so far, although the help files seem a bit unhelpful
hmmm...
as far as i know,
is this
>code1:string :='PASSWORD';
only allowed for global vars
initialize youe private members in your create-constructor of your object like
constructor TYourObjectName.Create(May
begin
inherited create(MaybeParameters);
code1 := 'PASSWORD';
code2 := 'USERNAME';
end;
or if it a form-object,
then use the oncreate-event for this
(no inherited is needed there)
hope this helps
meikl ;-)