in reply to Re: Win32::OLE X-Axis range question
in thread Win32::OLE X-Axis range question

I would like to change my $Range variable to be dynamic. I am still not sure how I would do that if for instance I would want to have a range from 1.0 to 8.0 with 0.1 increments.

Replies are listed 'Best First'.
Re^3: Win32::OLE X-Axis range question
by Anonymous Monk on Mar 13, 2009 at 11:07 UTC
    I don't follow
      Currently, I have hardcoded the range from 3.0 to 4.0 with 0.1 increment as follows.
      $Range->{value} = [['voltage', "cell($cell_addr)"], [3.0, $icell_hash{$cell_addr}{' 3.00'}], [3.1, $icell_hash{$cell_addr}{' 3.10'}], [3.2, $icell_hash{$cell_addr}{' 3.20'}], [3.3, $icell_hash{$cell_addr}{' 3.30'}], [3.4, $icell_hash{$cell_addr}{' 3.40'}], [3.5, $icell_hash{$cell_addr}{' 3.50'}], [3.6, $icell_hash{$cell_addr}{' 3.60'}], [3.7, $icell_hash{$cell_addr}{' 3.70'}], [3.8, $icell_hash{$cell_addr}{' 3.80'}], [3.9, $icell_hash{$cell_addr}{' 3.90'}], [4.0, $icell_hash{$cell_addr}{' 4.00'}],
      But if a user specified he wanted the range from 1.00 to 2.00 with a 0.1 increment for the X-axis then I would like the Range variable to look liks this. I just don't know how to change it other then hardcoding it in the code myself.
      $Range->{value} = [['voltage', "cell($cell_addr)"], [1.0, $icell_hash{$cell_addr}{' 3.00'}], [1.1, $icell_hash{$cell_addr}{' 3.10'}], [1.2, $icell_hash{$cell_addr}{' 3.20'}], [1.3, $icell_hash{$cell_addr}{' 3.30'}], [1.4, $icell_hash{$cell_addr}{' 3.40'}], [1.5, $icell_hash{$cell_addr}{' 3.50'}], [1.6, $icell_hash{$cell_addr}{' 3.60'}], [1.7, $icell_hash{$cell_addr}{' 3.70'}], [1.8, $icell_hash{$cell_addr}{' 3.80'}], [1.9, $icell_hash{$cell_addr}{' 3.90'}], [2.0, $icell_hash{$cell_addr}{' 4.00'}],
      I would like to have the code change thru some type of loop on runtime.
        Why can't you use sub ronge to do what you want?
        my @newrange = ronge(qw( 1.00 2.00 0.1 )); ...something to do with ole here ...