[ic] custom check fields - table_editor and flex_editor.

Andrew McBeath interchange-users@interchange.redhat.com
Wed Feb 6 17:01:00 2002


Thanks Mike,  you're a legend :)  - thats exactly what I was after.

Has anyone ever mentioned that IC is seriously cool? :)


Mike Heins wrote:

> 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.
>