Apologies if this is a long post for a simple problem, but I wanted to give as much info as possible.
This started as a simple diagnostic exercise to check that I was correctly getting the source paths of all 5 open tabs in the left explorer panel.
The script (note line 6 , beginning "$Paths...") is:
@var $Paths = "";
@var $n = 0;
for ( $n=1; $n<6; $n++ )
{
MC.SetActiveTab PANEL=LEFT TAB={$n};
$Paths += GetSourcePath() + "\r\n";
}
MessageBox ("Output",$Paths,0)
The Output, as expected, is:
C:\Alan\
C:\Zip\
C:\Tools\
C:\Temp\
C:\Users\Alan\
If I change line 6 to: $Paths += $n + GetSourcePath() + "\r\n"; the output, NOT as expected, is:
12345
It seems everything after $n is ignored in the concatenation !?
If I change line 6 to: $Paths += GetSourcePath() + " " + $n + "\r\n"; the output, again NOT as expected, is:
C:\Alan\ 1C:\Zip\ 2C:\Tools\ 3C:\Temp\ 4C:\Users\Alan\ 5
Once again, it seems everything after $n is ignored. Is this expected behaviour? Is there a workaround, or am I doing something wrong?
According to the documentation: "Conversion from string to number and number to string are often done automatically, making it possible to concatenate a number variable or constant to a string."
TIA
Alan