I encountered an AMPscript syntax error and the system implied me something didn't relate to the error. I wonder if there was another way to debug in MC.
%%[
var @greeting
set @greeting = ""
set @greeting = Concat(@greeting, "Just wanted to say ", Char(34), "Hello", Char(34), " ")
set @greeting = Concat(@greeting, "and tell you we", Char(39), "re b", Char(97,4), "ck!")
var @f_name, @l_name
set @f_name = AttributeValue("FirstName")
set @l_name = AttributeValue("LastName")
var @random_str, @first_w
set @random_str = "Hello my name is Duc"
if IndexOf(@random_str, " ") > 0 then
set @first_w = Substring(@random_str, 1, Subtract(Indexof(@random_str, " "), 1))
endif
]%%
%%[
var @terms, @termsBlurb, @len, @max
set @max = 105
set @terms = "" /* or a literal value */
set @terms = concat(@terms, "The Rewards program is intended for personal use only. ")
set @terms = concat(@terms, "Commercial use is prohibited. This program is not targeted towards, ")
set @terms = concat(@terms, "nor intended for use by, anyone under the age of 13. ")
set @terms = concat(@terms, "If you are between the ages of 13 and 18, you may only use Rewards ")
set @terms = concat(@terms, "under the supervision of a parent or legal guardian who agrees to ")
set @terms = concat(@terms, "be bound by these Terms of Use.")
set @termsBlurb = @terms
set @len = Length(@terms)
if @len > @max then
set @termsBlurb = concat(Trim(substring(@term, 1, @max),) "...") /* syntax error here */
endif
]%%
Hi %%=v(concat(@f_name, " ", @l_name))=%%
<br>greeting: %%=v(@greeting)=%%
<br>%%=v(@first_w)=%%
<br><br>terms: %%=v(@terms)=%%
<br>len: %%=v(@len)=%%
<br>termsBlurb: %%=v(@termsBlurb)=%%
In the 2nd AMPscript block, there was a syntax error and in somehow the system didn't show me the error but the announcement like the first picture.
P/s: I used VScode for coding AMPscript (AMPscript v1.4.3 extension for syntax highlighting) and it didn't show up the syntax error too. So I had to manually review the code and fixed it.