0
I need to create a function where I pass to the function a Checklistbox and this function will store in a variable the values of the checklistbox.
function PegaDescricao(checklistbox .......... ) : String;
var i, cont, descricao : Integer;
begin
cont := 0;
for i:=0 to checkListBox.Items.Count-1 do
begin
if cont = 0 then
begin
cont := contad +1;
descricao:=copy(checkListBox.Items.Strings[i],1,Length(checkListBox.Items.Strings[i])-4);
end
else
descricao:=descricao+', '+copy(checkListBox.Items.Strings[i],1,Length(checkListBox.Items.Strings[i])-4);
end;
end;
With this tip the problem was solved, only correcting in place of the Tckecklistbox parameter type I had to use the Tfrxchecklistboxcontrol type. Thus the function header: Function Pegadescricao(checklistbox: Tfrxchecklistboxcontrol) is: String;
– Renato