Can anybody let me know skill the function how to convert integer to string?
Ex: a=123 (integer)
pcExprToString should work as well.
I think that Andrew's answer is the way to go, use sprintf(). You can perform further processing using the cdfFormatFloatString() function too:
a = 123
formatted_a = cdfFormatFloatString( sprintf(nil "%d" a) "K")
oh..its really works well..
In reply to skillUser:
In reply to pvvikas:
Another question: How can I convert string to integer like this: "pmos" to pmos ???
In reply to Peach99:
Sorry, that doesn't make sense. "pmos" is a string, but pmos is not an integer. What are you actually trying to do? I could tell you how to convert a string to a symbol, but I'm not sure that's what you actually want?
In reply to Andrew Beckett:
I know that my statemant was wrong and I have found the correct function (stringToSymbol) I think! Thank you all the same!
How do you convert a string to a symbol or w_windowId? I am using Ocean and want to make the w_windowId variable in the hardCopy command from strings I created. This way I can change the windowId with my program based on other variables. I do not see the stringToSymbol function as described by another user.
var = "window1"
convertering steps to make "window1" to window1 (symbol or windowId)
Thanks for your help.
In reply to DonWP9:
The stringToSymbol function is a core SKILL function, so it is available in OCEAN. You could also choose to use concat()
for converting a string to a symbol - concat does not complain if you pass it either a string or a symbol, so it may be a little
more flexible than stringToSymbol, depending on your usage of the function.
In your post you mention "window1" - I'm used to seeing window id's like window:5 but perhaps yours is different because
it is a waveform window? However, if you have a window id like window:5 you can use the window function to return such
an id, e.g.
I hope this helps!