i get
function TForm1.GetArsHedef(): String;
const
DosyaAdi: String = 'hello';
i need
function TForm1.GetArsHedef(): String;
const
DosyaAdi: String = edit1.text+edit2.text;
but up the code not work who can help
now thanks . etekno
i get
function TForm1.GetArsHedef(): String;
const
DosyaAdi: String = 'hello';
i need
function TForm1.GetArsHedef(): String;
const
DosyaAdi: String = edit1.text+edit2.text;
but up the code not work who can help
now thanks . etekno
Constants have to be constant. They have to be known at compile time. You need a variable.
var
DosyaAdi: String;
....
DosyaAdi := edit1.text+edit2.text;
You need to use a variable, and in your function you won't even need to declare one. Delphi automatically declares the variable Result
in a function and makes it the proper type to be returned.
function TForm1.GetArsHedef(): String;
begin
Result := Edit1.Text + Edit2.Text;
end;
You cannot do what you wish to do. Constants are converted to their actual values at compile-time, and are not dynamic. Especially since this constant is local to a procedure, just use a variable instead. The word "constant" itself explains that it's intended to be the same value "constantly".
In any case, you cannot define or declare local variables or constants while setting their default values to another variable. To read the contents of these edit controls, it must be code explicitly written in the implementation to assign it.