The Siemens Community Catalyst program was co-created with our community to acknowledge technology leaders who consistently contribute to the Siemens Community. Nominations are accepted on a rolling basis.
Hi all, how to understand the following error?
set city(Guang zhou) 'Guangdong'
wrong # args: should be 'set varName ?newValue?'
set city(Guang\ zhou) 'Guangdong'
Guangdong
Why space cannot exist in array element index?
Roy
Array names (also variable name, proc name) must be one word
As tcl definition, string between 2 spaces is a word, or between 2 quotes or 2 braces
\ is a way to concate special characters to a word, so
Guang\ zhou
Is same as
'Guang zhou'
and same as
{Guang zhou}
is a word.
but
Guang zhou
are 2 words
Array names (also variable name, proc name) must be one word As tcl definition, string between 2 spaces is a word, or between 2 quotes or 2 braces \ is a way to concate special characters to a word, so Guang\ zhou Is same as 'Guang zhou' and same as {Guang zhou} is a word. but Guang zhou are 2 words
Array names (also variable name, proc name) must be one word
As tcl definition, string between 2 spaces is a word, or between 2 quotes or 2 braces
\ is a way to concate special characters to a word, so
Guang\ zhou
Hi @tinh
I try to use 'Guang zhou' or {Guang zhou}, the same error. However when using Guang,zhou, it is ok. How to understand?
Maybe :
set 'city(Guang zhou)' GuangZhou
so 'city(Guang zhou)' is a variable name, it is one word
array names ok to have multiple words
Maybe : set 'city(Guang zhou)' GuangZhou so 'city(Guang zhou)' is a variable name, it is one word array names ok to have multiple words
set 'city(Guang zhou)' GuangZhou
so 'city(Guang zhou)' is a variable name, it is one word
array names ok to have multiple words
I have tried your suggestion.
set 'city(Guang zhou)' 'Guangdong' it is ok.
How to understand why the previous statements were wrong?
Just understand as whatever you want.
If you can't, you don't need it to learn tcl, simply neglect all spaces.
Join us for a community conversation on Pulse Width Modulation (PWM), a fundamental technique in electric motor control, and explore how different PWM strategies can yield significantly different results. This webinar provides a comparative analysis of various PWM methods and their effects on motor efficiency, torque…
Join us for a community conversation to discover the Advanced Iterative Solver(AIS) in Simcenter Feko and its application to electrically large and computationally demanding electromagnetic models. The session will provide a general overview of how iterative solution methods can help improve efficiency of large scale…
Join us for a community conversation on how High-Performance Computing (HPC) and Simcenter PSIM work together to meet the increasing demands of modern power electronics simulation. During this one-hour technical session, you'll discover how leveraging HPC can speed up simulations, improve scalability, and empower engineers…