Skip to main content
1-Visitor
May 22, 2017
Question

Scripts encounter mysterious missing " ; " error even on 1st line of code.

  • May 22, 2017
  • 1 reply
  • 1931 views

As the title says my scripts will error our because of a missing " ; " even if the 1st line of code comes after comments, or is the 1st line in the file. Have to type new scripts pretty much completely by hand. It will allow me to paste small code chunks eventually, but it makes it difficult to tell the difference between this error and an actual missing " ; ".

Anyone advice for a fix or work around?

    1 reply

    16-Pearl
    May 22, 2017

    Is this a Windows or Unix system? Make sure the trigger script's file is of the right type and format.

    If you have copy/pasted code in it, make sure there are no invisible characters in there. I've had that happen to me when copying from a pdf file.

    Otherwise it's hard to diagnose without a close inspection of your file.

    bbean1-VisitorAuthor
    1-Visitor
    May 22, 2017

    Windows.

    I use all .js files for my trigger scripts, but I'm not sure if there is a specific PTC format I should be using.


    My 1st suspicion was the invisible characters as well. I checked that out using an online hidden character tool, with no results.

    16-Pearl
    May 22, 2017

    There's no specific PTC format, it's ECMA JavaScript in text file.

    I'll have a quick look if you can send me a sample.