In IDL documentation we call this "single value" a "scalar".
Sometimes you do not have to do anything. I am not 100% sure and I am not taking the time to test this right now, but I think the vast majority of IDL functions can treat 1-element arrays the same way they treat scalars.
Nevertheless, to be perfectly safe, you can always use the syntax:
myOneElementFloatArray[0]
Here are two examples where knowing about this syntax can be important: The very important filter function call "myTargetIndex = WHERE(...)" and the very important widget-handling procedure call "WIDGET_CONTROL, myTextWidget, GET_VALUE=text" both always return arrays, even when they have only one value to return. In this case the programmer needs to remember to always address that one value with the syntax "myTargetIndex[0]" resp. "text[0]".
Best of luck,
James
|