Вниз
Скачать: CL | DM;

использование bookmark   Найти похожие ветки 

← →
LDV   (2011-12-06 14:44) [0]

на сайте embarcadero нашел пример использования bookmark"ов. Почему перед GoToBookmark отсутствует проверка на BookmarkValid?


{
This example uses a button to copy the value of a field in
the previous record into the corresponding field in the
current record.
}
procedure TForm1.Button1Click(Sender: TObject);
var
  SavePlace: TBookmark;
  PrevValue: Variant;
begin
  with Customers do
  begin
   { get a bookmark so that we can return to the same record }
   SavePlace := GetBookmark;
   try
     { move to prior record}
     FindPrior;
     { get the value }
     PrevValue := FindField("Field2").Value;
     {Move back to the bookmark
     this may not be the next record anymore
     if something else is changing the dataset asynchronously }
     GotoBookmark(SavePlace);
     { Set the value }
     Edit;
     FindField("Field2").Value := PrevValue;
     { Free the bookmark }
   finally
     FreeBookmark(SavePlace);
   end;
 end;
end;


← →
Медвежонок Пятачок ©   (2011-12-06 14:48) [1]

потому что проверку не вставили в пример


← →
Ega23 ©   (2011-12-06 14:48) [2]

Почему перед GoToBookmark отсутствует проверка на BookmarkValid?

Потому, что НД не менялся.



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.003 c
2-1323670231
И. Павел
2011-12-12 10:10
2012.04.01
Почему «Return value must be undefined»?


4-1255347973
sD
2009-10-12 15:46
2012.04.01
Закрыть приложение


2-1323871689
upc
2011-12-14 18:08
2012.04.01
VirtualStringTree и ComboBox


15-1322598602
Юрий
2011-11-30 00:30
2012.04.01
С днем рождения ! 30 ноября 2011 среда


2-1323700171
Nikita_M
2011-12-12 18:29
2012.04.01
ComboBox в ячейке StringGrid




   Наверх