Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Scripting issue

Help
chris
2012-01-19
2013-05-30
  • chris
    chris
    2012-01-19

    Here is the following script I am having trouble with…
    function addImage(obj)

        var chain = new Array();
        var show, season;
        var location = obj.location.split('/');
        var rootindex = 0;
        var conchain = null;

        for (var i = rootindex; i < location.length; i++)
          {
           if (location_ == 'Photos')
            {
                rootindex = i;
                contchain = 'Photos');
                break;
            }
          }

        if (rootindex >= location.length)
          {
           return;
          }

        if (location != 'Photos')
          {
           return;
          }

        for (i = rootindex; i < location.length - 1; i++)
          {
           chain.push(contchain,location);
           print(chain+'/n');
          }
        addCdsObject(obj, createContainerChain(chain));
    }

    I am basically wanting to exit out of the routine if I reach the end of the string with no hit on picture or
    Photos is not in the location.

    It ignores this and adds pictures from anywhere that the other routines find a picture.
    What am I forgetting? or doing wrong… Also is there a flag to turn print on… I have enabled debug and also just ran with no debug on and I get no output when I call print('foo') from within any of my routines.

    Chris _

     
  • chris
    chris
    2012-01-23

    Fixed…. turned scripting on  again and it started to work.