Mercurial > forge
changeset 12427:a363fb87a236 octave-forge
Use __num2char__ for col-colstr conversion
author | prnienhuis |
---|---|
date | Sun, 13 Apr 2014 21:33:37 +0000 |
parents | cfe478a4d7e3 |
children | 760249bf866e |
files | main/io/inst/calccelladdress.m |
diffstat | 1 files changed, 10 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/main/io/inst/calccelladdress.m Sun Apr 13 21:33:01 2014 +0000 +++ b/main/io/inst/calccelladdress.m Sun Apr 13 21:33:37 2014 +0000 @@ -1,4 +1,4 @@ -## Copyright (C) 2009,2010,2011 Philip Nienhuis <pr.nienhuis@users.sf.net> +## Copyright (C) 2009,2010,2011,2012,2013,2014 Philip Nienhuis ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software @@ -30,7 +30,8 @@ ## 2011-04-30 Simplified column name computation ## 2011-12-17 Bugfix for wrong column address if column equals multiple of 26 ## 2011-12-18 Added tests for multiple-of-26 cases -## 2012-10-24 Style fixes +## 2012-10-24 Style fixes +## 2014-04-13 Use by __num2char__ for colstr->col conversion function [ celladdress ] = calccelladdress (row, column) @@ -43,14 +44,14 @@ error ('Specified row out of range (1..1048576)'); endif - str = ''; - while (column > 0.01) - rmd = floor ((column - 1) / 26); - str = [ char(column - rmd * 26 + 'A' - 1) str ]; - column = rmd; - endwhile +% str = ''; +% while (column > 0.01) +% rmd = floor ((column - 1) / 26); +% str = [ char(column - rmd * 26 + 'A' - 1) str ]; +% column = rmd; +% endwhile - celladdress = sprintf ("%s%d", str, row); + celladdress = sprintf ("%s%d", __num2char__ (column), row); endfunction