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!
Hello all, good topic
I would like also to use a conversion of string to symbol in such a way but something is not ok.
The received value is nil ... but should not be. ("opt1" and "opt2" are just for example)
How I can perform this operation?
In reply to jazzmatazz:
The -> operator does not evaluate the property name argument - it takes it literally. So this is looking for a property called "a" on the window, and then a property "b" on that.
You'd have to use the get() function instead:
get(get(hiGetCurrentWindow() a) b)
Thanks Andrew, And what if the properties are in the body of the command
I have no idea what you mean by "the properties are in the body of a command". Please give a real example - this is a bit abstract at the moment and it's hard to understand what you're asking.
Actually now I realize that this is not property , but it's argument for the command.
The command is with syntax
The question is how I can build this argument for proper evaluation
And probably this question have to be moved to another topic :)