Quantcast
Channel: Planet Object Pascal
Viewing all articles
Browse latest Browse all 1725

TPersistent: SyncEdit How UseFul is It?

$
0
0

Today I ran across yet another limitation of SyncEdit.  Incredible you say?  Check out the following sample code:

procedure CreatePackage(anInvoiceItem :ThcInvoiceItem; aClient :ThcClient);
begin
  if anInvoiceItem.AssociatedProduct.StockType.AsString = 'PACK' then
    CreatePackage(anInvoiceItem.AssociatedProduct.PackageType.AsString);
end;

Rather than use a Search/Replace as I would normally, I chose to invoke SyncEdit after highlighting the method.  Then I discovered I could not replace anInvoiceItem.AssociatedProduct with aProduct.  SyncEdit will not allow you to remove an identifier, so the closest I could get was a.aProduct.  Likewise, SyncEdit cannot be invoked when you use Ctrl+A to select the entire unit.  While it may be flashy, it’s not as flexible or as fast to use as Search/Replace IMHO.


Viewing all articles
Browse latest Browse all 1725

Trending Articles