[ic] custom check fields - table_editor and flex_editor.

Mike Heins interchange-users@interchange.redhat.com
Wed Feb 6 13:08:00 2002


Quoting Andrew McBeath (andrew@ecombiz.co.nz):
> This is so I can build an array in flex_editor and then put something like:
> custom_check="[scratch my_array_goes_here]"
> into the table-editor tag, and then in table_editor.tag swap/append to 
> the existing $check array.
> 

You can test stuff like this pretty easily with a simple UserTag
in catalog.cfg.

UserTag test-opt addAttr
UserTag test-opt Routine <<EOR
sub {
	my $opt = shift;
	return uneval($opt);
}
EOR

First of all, check.something="[scratch var]" will not work.
The value is never interpolated for IC tags. But you can
do:

	check.something=`$Scratch->{var}`
	check.something=`$Scratch->{var}`

So let's try some stuff:

    [calc]
	$testhash = {  
			    tom => 'jerry',
			    elmer => 'bugs',
		    };  
    [/calc]

    [test-opt check=`$testhash`]

This gives as expected:

    {'reparse' => "1",'check' => {'tom' => "jerry",'elmer' => "bugs",},} 

Now what I think you want to do:

    [test-opt
	check=`$testhash`
	check.sylvester="tweetie bird"
	check.elmer=bugs
	]

This gives:

    {'reparse' => "1",
	'check' => {
		'tom' => "jerry",
		'elmer' => "bugs",
		'sylvester' => "tweetie bird",
	},
   }

Perhaps not as obvious to everyone else as to me, the first call to
check=`$somehash` must come first.

-- 
Red Hat, Inc., 3005 Nichols Rd., Hamilton, OH  45013
phone +1.513.523.7621      <mheins@redhat.com>

For a successful technology, reality must take precedence over public
relations, for Nature cannot be fooled. -- Dick Feynman