ArborX


hash

Longname: hash   Open the Documentation Legend
Released: 7.80 
Created: 7.80 
See also: var Technote: 0080

Summary
A keyword used with function variables: ^[funcname parameter(s)]. This syntax can be used anywhere that a regular 3B2 variable can be used: in show strings, in scripts, in expressions, etc. Function variables are a V8 feature that uniforms variable use and functions into a readable syntax. ^[hash any_string] returns a number representing the string. The string can be very long or in a variable.
Example extract

The following show string will display the current value of the th command (text height).

 <?show ^[prop th]?>

Syntax (8.00)
hash string:s
string:s

Any string.

For a practical example, you might want to format a show string and only process the result when it's different from the previous time the show string was formatted. You would request a hash of the result stream with:

 <?show ^[hash ^"stream_name"]>

and just store the number returned in a formatting counter. If it's different from the previous counter value then process the result stream. The benefit of this is that it prevents the need to keep two show string streams (which might be large) to compare with each other.


Document created on 06-Jan-2005 (revision 1)