----------- ------------ ------------- |excel | | | | | |template | <== | callback | <==== |database | | | | | |___________| | | | | --------- |___________| <===== ------------- | | |DCOM server | | | -------------- #### sub cell_walk{ my $self = shift; my ($sheet_name, $x, $y, $callback) = @_; my $Sheet = $self->{ 'book_handle' }->Worksheets($sheet_name); for ( $row = $x->[0] ; $row <= $y->[0] ; $row++ ) { for ( my $col = $x->[1] ; $col <= $y->[1] ; $col++ ) { $callback->($Sheet->Cells( $row, $col )); } } } sub callback{ return if !defined $_[0]->{Value}; if ( $_[0]->{Value} =~ /^~~~/ ) { my @a = split( /__/, substr( $_[0]->{Value}, 3 ) ); #grab useful string if( scalar @a == 3){ $_[0]->{Value} = $hl->get_single_LP( 'ADAS_VAL_RAW', @a ); } if( scalar @a == 4){ $_[0]->{Value} = $hl->accu_LP( 'ADAS_VAL_NORM', @a ); } } }