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