STRING with FORMAT keyword and REFORM [message #46919] |
Wed, 11 January 2006 07:11 |
btt
Messages: 345 Registered: December 2000
|
Senior Member |
|
|
Hello All,
I just bumped into a funny thing. When calling
result = STRING(array, FORMAT = '(something'))
a 2d array is reformed into a 1d array.
Here's an example...
print, !VERSION
;{ ppc darwin unix Mac OS X 6.2 Jun 20 2005 32 32}
number = REBIN(INDGEN(1,10), 10,10)
text = STRING(number, FORMAT = '(I2.2)')
help, number, text
;NUMBER INT = Array[10, 10]
;TEXT STRING = Array[100] <<<<< reformed, nuts!
text = STRING(number)
help, number, text
;NUMBER INT = Array[10, 10]
;TEXT STRING = Array[10, 10] <<<< not reformed
text = STRING(text, format = '(I2.2)')
help, number, text
;NUMBER INT = Array[10, 10]
;TEXT STRING = Array[100] <<< still reformed
I can re-reform the array, but nothing pops out at me from the online
help about this. Is this expected behavior?
Thanks,
Ben
|
|
|