Macro Language Reference > PIs > Text > <?fishdown>
  
<?fishdown>
Description
When a <?fishup> processing instruction is used, the values of all existing FISH variables are preserved. This will take into account all set/reset actions that follow the command and change the value of the variable(s). When PTC ALD encounters a subsequent <?fishdown> command the FISH variables are reset to the values they held when the last up was made. These commands enable PTC ALD to capture a set of variables and their values and use them for the purposes of inheritance.
<?fishup [hashno]> <?fishdown [hashno]>
 
Example 459. Preserve variable values using <?fishup> and <?fishdown>
<?show"^[fish0,test]"hello>
<?show$^[fish0, test]
These two lines will firstly set the value of a FISH variable called test in hash 0 to "hello", then return the value of the FISH variable test from hash 0. Here the output will be "hello".
<?fishup0>
<?show"^[fish0,test]"world>
<?show$^[fish0, test]
Whereas these three lines, with the inclusion of the <?fishup> command, will reset the value of the same variable in hash 0 to "world".
<?fishdown 0>
<?show$^[fish0, test]>
Following the <?fishup> command with these two lines will reset the value of the same variable to the value it held before the <?fishup> command was processed. The output here will now be "hello".
Syntax
<?fishdown hash_num:n>
<?fishdown>
[no parameter]
Reset value of the FISH variables.
hash_num
The hash number to which the operation should write the reset value of the FISH variables.
Additional Information
Format Inheritable String Hashes (FISH) provide a mechanism for storing variables in a stack based system, with the ability to allow for inheritance of the values down through the stack. This is useful when processing data in a tree structure, i.e. XML, where the properties of an element need to be retained and inherited by its children.
For more information, see Technote 0087: Format Inheritable String Hashes (FISH).
Related Links