how to store and extract integer value to CheckListBox

How to add and then extract integer value to CheckListBox?

I did something like this:
if DS_Stawki.Active then DS_Stawki.Close;
     DS_Stawki.Open;
  while not DS_Stawki.Eof do
  begin              
  CheckListBox1.Items.AddObject(<DS_STAWKI."string">,TObject(<DS_STAWKI."ID">));
  DS_Stawki.Next;                                  
  end;



But how to extract ID value?
I Try this:
for i:= 0 to  CheckListBox1.Items.Count -1 do
 if CheckListBox1.Checked[i] then
 begin
     ID := Integer(CheckListBox1.Items.Objects[i]);
 end;

I get error: too many parameters

Comments

  • edited 2:56PM
    Can onyone to help me?
    It's very needed!
  • edited 2:56PM
    Try to use

    ID := StrToInt( VarToStr( CheckListBox1.Items.Objects))


    Mick

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.