scratchd — return value of scratch variable, then delete the variable
Attribute | Pos. | Req. | Default | Description |
---|---|---|---|---|
name | Yes | Yes | Name of the scratch variable. | |
filter | Filter to apply to the value. | |||
interpolate | 0 | interpolate output? | ||
hide | 0 | Hide the tag return value? |
Scratch variables cannot be set using the [scratch]
tag; see
scratch glossary entry for a complete discussion.
Interchange 5.9.0:
Source: code/SystemTag/scratchd.coretag
Lines: 23
# Copyright 2002-2007 Interchange Development Group and others # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. See the LICENSE file for details. # # $Id: scratchd.coretag,v 1.6 2007-03-30 23:40:49 pajamian Exp $ UserTag scratchd Order name UserTag scratchd PosNumber 1 UserTag scratchd addAttr UserTag scratchd Version $Revision: 1.6 $ UserTag scratchd Routine <<EOR sub { my ($var, $opt) = @_; my $value = delete $::Scratch->{$var}; if ($opt->{filter}) { $value = filter_value($opt->{filter}, $value, $var); } return $value; } EOR