Evaluator: No automatic type conversion for index

I expected Advanced Renamer to use this expression:

{=index + "_" + Chr(64 + index)=}

to create file names with an alphabetical index:

1_A  
2_B  
3_C

However, index is treated as a string and is not automatically converted to an integer. As a result, 64 + 1 is evaluated as 641 instead of 65, causing Chr() to generate unintended characters:

Fortunately, I can force type conversion with the following modification:

{=index + "_" + Chr(64 + (index as int))=}


Interesting observation: The entire eval expression is case-insensitive, except for int, which must be written in lowercase.


I'm unsure if this qualifies as a bug report or a quick tutorial.

2 Likes

Here's another twist.

{=index + "_" + Chr(64 + abs(index))=} also seems to work, but I can't get the index to increment. {=index=} doesn't increment either.

Yes, this works as well.

{=index=} not incrementing seems to occur after clicking around in the dialog for a while. It has happened to me twice, but I haven't been able to reproduce it consistently.

Closing and reopening the dialog should resolve it.

Thanks.
I saved it as a preset, then closed and reopened the dialog.
That fixed it.