How do I use the Dollar $ in ICM Scripts?

1 view
Skip to first unread message

MolSoft ICM Knowledge Base

unread,
Mar 28, 2017, 5:15:44 PM3/28/17
to MolSoft ICM Knowledge Base
Question:
How do I use the Dollar $ in ICM Scripts?
Answer:
In ICM you need to use '$' ONLY before string variable which contains the name of the OTHER variable or expression. (that different from Perl)

Using dollar in most other cases won't hurt (e.g: $a (where a is an integer variable) but will have no effect and only will make parsing/execution heavier. For example: a = 1 # the two lines below are equivalent print $a print a

Example of dollar usage:

a = 1
s = "a"
print $s   # will print the content of 'a' variable
#
for i=1,10
  s = "a" + i
  $s = i
endfor

Will create a1,a2,...a10 variable with corresponding values.

So you should consider '$' as a substitution of the content of the string variable after it.

build string "AAA"
s = String( a_ )
print s
$s 


Reply all
Reply to author
Forward
0 new messages