Apple Newton Utilities Uživatelská příručka Strana 513

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 942
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 512
CHAPTER 12
Special-Purpose Objects for Data Storage and Retrieval
Using Special-Purpose Data Storage Objects 12-7
Using Special-Purpose Data Storage Objects 12
This section describes how to use entry aliases, virtual binary objects (VBOs),
store parts, and mock entries. This section presumes understanding of the
conceptual material presented in preceding sections.
Using Entry Aliases 12
This section describes how to create entry aliases, how to save them, and how to
resolve them.
Aliases can be created for any entry that resides in a soup or union soup. Aliases
cannot be created for mock entry objects.
You must not assume that an entry alias is valid. When the entry to which it refers
is deleted or is moved to another store, an entry alias becomes invalid. Renaming a
store renders invalid all aliases to entries residing on that store.
The
MakeEntryAlias function returns an alias to a soup entry, as shown in the
following code fragment:
// return entries that contain "bob" and "Apple"
local myCurs:= namesSoup:Query({ entireWords: true,
words:["Bob", "Apple"]});
// keep an alias to bob around
local bobAlias := MakeEntryAlias(myCurs:Entry());
// but get rid of the cursor
myCurs := nil;
To save an entry alias, simply save it in a soup entry.
You can use the
ResolveEntryAlias function to obtain the entry to which the
alias refers, as shown in the following code fragment:
// continued from previous example
local bobEntry := ResolveEntryAlias(bobAlias);
Note that the ResolveEntryAlias function returns nil if the original store,
soup, or entry to which the alias refers is unavailable.
Zobrazit stránku 512
1 2 ... 508 509 510 511 512 513 514 515 516 517 518 ... 941 942

Komentáře k této Příručce

Žádné komentáře