Determining a safe variable name from a string [message #51033] |
Tue, 31 October 2006 09:53 |
Ben Panter
Messages: 102 Registered: July 2003
|
Senior Member |
|
|
Hi Folks,
I'm sure I've seen this here before, but extensive googling didn't
trawl anything up. I'd like to be able to convert a random string into
something I can use for a variable name (heavy execute'ing going on
here). Something that clears out all the ./*/&//'s and the like. Ideally
it would replace them with something useful, realistically I'd be happy
if it just removed the unsafe characters from the string.
something like:
res=wonderful_routine('vmax_z0.1_0.3')
print, res
vmax_z0p1_0p3
I've already written something similar which I can butcher, but I'm
sure there was an IDL routine that did this already?
Many thanks,
Ben
--
Ben Panter, Edinburgh, UK.
Email false, http://www.benpanter.co.uk
or you could try ben at ^^^^^^^^^^^^^^^
|
|
|