por lo que creo que intentas hacer es saber que registros están seleccionados en el listView, para lo cual intenta sustituyendo tu linea del punto 2
Código Delphi
[-] if (ListView.Selected = nil) then
por esta otra
Código Delphi
[-]if ( ListView.Items[i].Selected ) then
En cuanto a lo de convertir una cadena en numero lo que tienes funciona siempre que la cadena sea realmente un numero, en caso contrario te dará un error, para evitar el error, inténtalo así:
Código Delphi
[-] if not TryStrToInt(ListView.Items.Item[0].SubItems[0], Repetir) then
MessageDlg('El valor no es correcto', mtError, [mbOK], 0)
else if ( ListView.Items[i].Selected ) then begin
with IBQGrabar do
begin
SQL.Text := 'INSERT INTO TREGISTROS'
+ '(PROCEDIMIENTO, CODIGO_PROCEDIMIENTO, VALOR)'
+ 'VALUES(:PROCEDIMIENTO, :CODIGO_PROCEDIMIENTO, :VALOR)';
IBQGrabar .ParamByName('PROCEDIMIENTO').AsString:= ListView.Items.Item[0].SubItems[1];
IBQGrabar .ParamByName('CODIGO_PROCEDIMIENTO').AsInteger:= ListView.Items.Item[0].SubItems[2];
IBQGrabar .ParamByName('VALOR').AsFloat:= StrToFloatDef(ListView.Items.Item[0].SubItems[3], 0);
For j := 1 to Repetir do
ExecSQL;
end;
end;