Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2012.04.01;
Скачать: 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 вся ветка

Текущий архив: 2012.04.01;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.006 c
2-1323789641
Мелкий
2011-12-13 19:20
2012.04.01
О высоте строки в ListView


3-1260010688
Xmen
2009-12-05 13:58
2012.04.01
не могу соединится с базой


2-1323630561
CheCoder
2011-12-11 23:09
2012.04.01
Delphi 7. Почему Image1.Canvas не печатается?


1-1290074442
Дмитрий Белькевич
2010-11-18 13:00
2012.04.01
Есть форма fsMDIChild, как добраться до её fsMDIForm?


2-1323870171
Alex_C
2011-12-14 17:42
2012.04.01
Что лучше поле MyTablePole или MyTable.FieldByName( Pole )