Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: javascript unterminated string litteral

  1. #1

    Default javascript unterminated string litteral

    I'm getting the below error when concatenating a string to a string.
    I terminated the line with a ";". What could be causing the issue?

    Thanks,
    David
    Attached Images Attached Images  

  2. #2
    Join Date
    Mar 2006
    Posts
    114

    Smile

    reverse the bar

    incorret
    var teste = "\path\path2";

    correct
    var teste = "/path/path2";

  3. #3

    Smile

    Figured out that I needed to "Escape" the backslashes. This is what worked for me.

    // moveFile a file.
    //
    // Usage:
    // moveFile(var1,var2,var3);
    // 1: String - The file to move with Path.
    // 2: String - The destination filename with Path.
    // 3: Boolean- Overwrite destination file if exists.
    // 2007-10-29
    //



    var destinationPath = getParentFoldername(PATH_FILE) + "\\Archive\\";
    var sourceFile = PATH_FILE;
    var destinationFile = destinationPath + getShortFilename(PATH_FILE);

    //Alert(destinationFile);

    try
    {
    moveFile(sourceFile,destinationFile,false);
    }
    catch(err)
    {
    var test = "warning";
    }



    Thank you for your help!
    David

  4. #4
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    A forward slash works on all platforms, a backslash only on Windows.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.