AN1009 - Scope and Name Searching

From Serious Documentation
Revision as of 04:51, 28 June 2017 by TerryWest (talk | contribs)
Jump to: navigation, search

When you use a named object's name in a reference (e.g. "myPageFrame.oh" or "image7.ow") in a script or a layout rule, how does SHIPTide "find" that object? If there are two objects or more with the same name in your GUI, and you reference that name, which one does it pick to refer to?

This app note discusses how SHIPTide does "name searching" and the various developer options to control and manage unexpected behavior.

This video app note is currently in production; thanks for your patience.

Search Rules Summarized

When an object name is referenced:

  • The name is searched for in the direct parent -- any object directly under the parent (i.e. a direct sibling to the refer-er) with that name will be used. This is a common thing in all languages can called "local scope".
  • If no sibling with that name exists, the parent name is checked for a match
  • If the parent name does not match, this process is repeated upwards. In other words, the parent's siblings are checked, then the parent's parent's name, and so on.
  • This recursive search upwards stops at the top of the "area" that the refer-er lives in (e.g. layout, resources, etc.)
  • If the Developer Settings - Global Search/Include Platform (see below on Name Search Options) is enabled, SHIPTide now traverses top-down the platform area looking for the first occurrence of that name
  • If the "Include Resources" global search is enabled, SHIPTide now traverses top-down the resources area looking for the first occurrence of that name
  • If the "Include Cargo" global search is enabled, SHIPTide now traverses top-down the cargo description (version, copyright, etc.) area looking for the first occurrence of that name
  • If the "Include Layout" global search is enabled, SHIPTide now traverses top-down the layout area looking for the first occurrence of that name
  • If the name is still not found, SHIPTide shows a reference error

For example, study this sample GUI area where the name "var" is referenced:

Unqualified Name Searches

When you use an "unqualified" name, for example "myPageFrame.oh", and assuming global searching is enabled in the developer panel in SHIPTide,

Qualified Name Searches


Name Search Options

Under the "Developer Settings" area in SHIPTide you can modify the global search behavior to prevent global name searching. We recommend you consider at least turning off the "Include Layout" search so that scripts and layout rules must refer to other layout objects explicitly.

Name Search Options

Notes

Known Issues/Errata

  • none

Related Content