CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [Zhris] How to write dispatch tables ? How to send arguements to the functions : Edit Log



Tejas
User

Dec 21, 2014, 4:27 AM


Views: 39360
Re: [Zhris] How to write dispatch tables ? How to send arguements to the functions

Hi Chris


Code
$grid{1}{1} = sub {  qq/=EOMONTH(B2,-1)+1/ };  
$grid{1}{4} = sub { my ($row,$offset) = @_; $row = $row+1 ;qq/=B${row}-$offset/ };
$grid{1}{7} = sub { my ($row,$offset) = @_; $row = $row+1 ;qq/=B${row}-$offset/ };
$grid{1}{9} = sub { my ($row,$offset) = @_; $row = $row+1 ;qq/=B${row}-$offset/ };


This is hash version, with functions,paraments here are to be replaced in the formulas ..
If u see the four formulas,the sub routine takes arguemets and its adding up the offset variable .

But how can that be ahceivable using array
Where should i ppush the $row and $offset paraments here in array..


Code
$grid->[1]->[0] = [ 'write_formula', '=B${row}', $format ];   
$grid->[1]->[1] = [ 'write_string' , 'qq/=B${row}-$offset/' , $format ];


Thanks
Tejas


(This post was edited by Tejas on Dec 21, 2014, 4:29 AM)


Edit Log:
Post edited by Tejas (User) on Dec 21, 2014, 4:29 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives