label = Substitute(...) Error?

Why is this line showing a flag in the IDE for wrong syntax?

label = Substitute("Watch Now {1}", "$1.99")

Indexes begin at 0. So try

label = Substitute("Watch Now {0}", "$1.99")

https://sdkdocs.roku.com/display/sdkdoc/Global+String+Functions#GlobalStringFunctions-Substitute(strasString,arg0asString,arg1=%22%22asString,arg2=%22%22asString,arg3=%22%22asString)asString

Substitute(str as String, arg0 as String, arg1 = “” as String, arg2 = “” as String, arg3 = “” as String) as String
Replaces all instances of {0} or ^0 in str with arg0. Similarly, replaces all instances of {1} or ^1 with arg1, {2} or ^2 with arg2, and {3} or ^3 with arg3.

Example


thing = "book"
color = "red"
print Substitute("My {0} is {1}.", thing, color) ' prints "My book is red."

I tried:

label = Substitute("Watch Now {0}", "$1,99")

…but Eclipse still is flagging a syntax error.

BUT the code side-loads and runs fine on Roku!

Could this be a bug in the Eclipse plugin for Roku?

If the code works sideloaded in Roku without any errors then yes, I think eclipse isn’t updated to return the correct status.