Difference between revisions of "Sys FoundSet"

(Created page with "category:System Variables category:Analytica 5.0 ''New to Analytica 5.0'' == SysVar Sys_FoundSet == Sys_FoundSet is an Analytica system variable that is pop...")
 
m
 
Line 3: Line 3:
  
 
''New to [[Analytica 5.0]]''
 
''New to [[Analytica 5.0]]''
 +
'''Sys_FoundSet''' is a system variable that contains a list of the objects found by the last search using the  [[Find dialog]]. 
  
 
== SysVar Sys_FoundSet ==
 
== SysVar Sys_FoundSet ==
  
[[Sys_FoundSet]] is an Analytica system variable that is populated by the [[Find dialog]] with a list of [[handle]]s to objects that match your search criteria. The contents of this system variable is depicted in the [[Outline window]], and nodes in the found set may be displayed with a [[image:Magnifying glass.png]], as seen on several nodes here:
+
[[Sys_FoundSet]] is an Analytica system variable that contains the results of the last search using [[Find dialog]] as a list of [[handle]]s to the objects matching your search criteria. You can see these objects in the '''Found Objects''' module in the [[Outline window]]. This list appears if you click the '''List''' button in the [[Find dialog]].  In a [[Diagram window]], the node for each object in [[Sys_FoundSet]] is marked with a
 +
[[image:Magnifying glass.png]]:
  
 
: [[image:FoundSetOnDiagram.png]]
 
: [[image:FoundSetOnDiagram.png]]
Line 14: Line 16:
 
</div>
 
</div>
  
The [[image:Magnifying glass.png]] icons show on the nodes only when the system variable [[DepictFoundSetOnUI]] is true. This system variable is toggle from the [[Find dialog]] by toggling the checkbox for '''Show matches with [[image:Magnifying glass.png]]'''.
+
You can can toggle whether to mark Found objects with the [[image:Magnifying glass.png]] icon in the [[Find dialog]] with '''Show matches with [[image:Magnifying glass.png]]''' checkbox. You can also toggle it in an [[OnClick]] or [[Onchange]] script by assigning true (1) to system variable [[DepictFoundSetOnUI]].
  
 
== Assigning to Sys_FoundSet ==
 
== Assigning to Sys_FoundSet ==
  
There are a lot of useful things you can do by computing a list of handles and assigning that list to [[Sys_FoundSet]]. Many of these involve using the [[FindObjects]] function. The usefulness comes from the fact that the [[image:Magnifying glass.png]] icons appear, giving you a way to flag nodes based on a computed criteria.
+
You can also assign a list of handles to [[Sys_FoundSet]] in an [[OnClick]] or [[Onchange]] script to mark those nodes with the [[image:Magnifying glass.png]] icon. For example, if you want to write a function to identify the variables in a [[dynamic loop]] or objects which are missing a [[Description]] attribute. Often you might use the built-in [[FindObjects]] function, which provides considerably more power and flexibility that the [[Find dialog]].  
  
For example, when debugging, it can be useful to know which variables are in the same [[dynamic loop]] as a given variable, say <code>Inventory</code>. From a button's [[OnClick]], you could set the found set to all variables in the same dynamic loop using:
+
For example, this could help you debug a dynamic loop by showing all the variables in the same loop as  
 +
a variable of interest, say <code>Inventory</code>. This code in a button's [[OnClick]] attribute shows all objects that influence <code>Inventory</code> and are influenced by it, and so are in the same dynamic loop:
  
 
:<code>Sys_FoundSet := [[FindObjects]]( influences:[[Handle]](Inventory), influencedBy:[[Handle]](Inventory) )</code>
 
:<code>Sys_FoundSet := [[FindObjects]]( influences:[[Handle]](Inventory), influencedBy:[[Handle]](Inventory) )</code>
  
Having the nodes visually marked can help during debugging of complex dynamic loops that span many different diagrams.
+
This can be especially helpful with a complex dynamic loop that spans variables in several different diagrams.
  
 
Because the set you assign is computed, virtually any criteria is possible. Of course, the point with using the feature is that the [[image:Magnifying glass.png]] icons are temporary.
 
Because the set you assign is computed, virtually any criteria is possible. Of course, the point with using the feature is that the [[image:Magnifying glass.png]] icons are temporary.

Latest revision as of 00:52, 1 September 2018


New to Analytica 5.0 Sys_FoundSet is a system variable that contains a list of the objects found by the last search using the Find dialog.

SysVar Sys_FoundSet

Sys_FoundSet is an Analytica system variable that contains the results of the last search using Find dialog as a list of handles to the objects matching your search criteria. You can see these objects in the Found Objects module in the Outline window. This list appears if you click the List button in the Find dialog. In a Diagram window, the node for each object in Sys_FoundSet is marked with a Magnifying glass.png:

FoundSetOnDiagram.png

SysVar DepictFoundSetOnUI

You can can toggle whether to mark Found objects with the Magnifying glass.png icon in the Find dialog with Show matches with Magnifying glass.png checkbox. You can also toggle it in an OnClick or Onchange script by assigning true (1) to system variable DepictFoundSetOnUI.

Assigning to Sys_FoundSet

You can also assign a list of handles to Sys_FoundSet in an OnClick or Onchange script to mark those nodes with the Magnifying glass.png icon. For example, if you want to write a function to identify the variables in a dynamic loop or objects which are missing a Description attribute. Often you might use the built-in FindObjects function, which provides considerably more power and flexibility that the Find dialog.

For example, this could help you debug a dynamic loop by showing all the variables in the same loop as a variable of interest, say Inventory. This code in a button's OnClick attribute shows all objects that influence Inventory and are influenced by it, and so are in the same dynamic loop:

Sys_FoundSet := FindObjects( influences:Handle(Inventory), influencedBy:Handle(Inventory) )

This can be especially helpful with a complex dynamic loop that spans variables in several different diagrams.

Because the set you assign is computed, virtually any criteria is possible. Of course, the point with using the feature is that the Magnifying glass.png icons are temporary.

See Also

Comments


You are not allowed to post comments.