What do these error messages mean in the Logic sections?

When an author goes into A2J Author 5.0 and clicks the "All Logic" tab, some of the question boxes are red and have an error message. What do those error messages mean?

A2J Author 5.0 is more strict in its scripting than A2J Author 4.0 was. Therefore, things that worked in 4.0 will need to be revised in order to run properly in 5.0. Below are some sample error messages and how to resolve the errors. The error message will be italicized here. The error will be emboldened. 

  1. IF HASANSWERED([Doesn't have new Guardian 1 TE]) Unexpected token ILLEGAL
    • ​Solution: You cannot have an apostrophe in your variable name. Take out the apostrophe and it will solve the error.
  2. IF HASANSWERED([Declarant SSN TE#]) Unexpected Identifier
    • ​​Solution: You cannot have a # sign at the end of your variable. It can still be used for repeate loops and indices. 
  3. IF HASANSWERED([Other Party Zip NU])=true or or HASANSWERED([Home County])=true Unexpected token II
    • Solution: the two lines (II) are Javascript for the word "or"- Here A2J Author is telling you that you have included two "or"s next to one another. Remove one "or" and the logic will work. 
  4. IF ([Domestic violence trigger TF] = true and [Problem Type MC]= "37" or ([Problem MC] = "DV" and [Problem Type MC]= "37") or [Senior NU] ="1" Unexpected token } 
    • Solution: The author forgot to close their first set of parenthesis. The "}" symbol is Javascript's way of telling you 
  5. SET [non-resident alient TE] to "Since you are not a US citizen, you may not be able to file this affidavit. Unexpected token ILLEGAL
    • Solution: The author forgot to close their quote at the end (after the word affidavit). Adding a closing quotation mark would solve the logic error. 
  6. IF [Duty 1 TF] = false or Unexpected token                                                      [Duty 2 TF] = false or Unknown command                                                       [Duty 3 TF] = false or  Unknown command                                              [Duty 4 TF] = false or Unknown command                                                       GOTO "01- Do not agree" 
    • Solution: The author added extra hard returns (breaks) after each Variable name = false. This broke the logic. Javascript requires a single expression to be on one line. The line can wrap (flow to the next line automatically), but the author cannot create a break (by hitting enter/return) or the logic will fail. This error can be solved by putting the entire expression on one line. You cannot start a new line without a command (IF, ELSE, GOTO, SET, etc) 
  7. IF 1:1 Unexpected token
    • Solution: You cannot use a colon to compare two items. The author is trying to make the condition always show up (using the 1=1 condition in A2J Author 4.0). However, the colon isn't the appropriate way to do that in 5.0 now. 1=1 would have worked, but 1:1 does not work. 
    • Note- you DO NOT need a conditon now to have the advanced logic always do something. You can just command it to do something (like a set a new variable or go to a specific page) by using the SET command. 
  8. IF HASANSWERED([Guardian 1 middle name TE])                                     SET [Guardian 1 full name TE] to %%[Guardian 1 first name TE]%% + " " + %%[Guardian 1 middle name TE]%% + "  " + %%[Guardian 1 last name TE]%% Unexpected token %
  • ​Solution: You cannot have a %% in your logic code. You no longer need the double % to call out the value of the variable (for a variable macro) in the logic. Note- you will need to use %%[Variable name]%% to call out the value in the question text and learn more answer sections. Just not in the advanced logic section anymore.