0

I have this piece of code below which works perfectly. However I would like to integrate the following:

   if (marker_Type = "Comment")
                {marker_Type = "company 1"}
                else
                {marker_Type = "company 2"}

You can see the complete section below

for(var current_marker = markers.getFirstMarker();
                current_marker !== undefined;
                current_marker = markers.getNextMarker(current_marker)){
                    count++;
                    var selectIn = current_marker.start.seconds;
                    mySeq.setInPoint(selectIn);
                    var getIn = mySeq.getInPoint();
                    var selectOut = current_marker.end.seconds;
                    mySeq.setOutPoint(selectOut);   
                    var getOut = mySeq.getOutPoint();
                    var marker_Name = current_marker.name;
                    var marker_Comments = current_marker.comments;


                    // marker_Type can either be "Comments" or "Chapter"
                    var marker_Type = current_marker.type;


                    logInfo((new Date).toString());
                    function logInfo(Txt){


                      if (marker_Type = "Comment")
                {marker_Type = "company 1"}
                else
                {marker_Type = "company 2"}


                    var file = new File(path1+sep1+"VID"+sequenceName+"MID"+count+"__"+marker_Name+"__"+marker_Type+".txt");
                    file.open("w");
                    file.writeln(marker_Comments+"|"+selectIn+"|"+selectOut);
                    file.close();
                    };

I have tried to get the code working but for some reason it does not work? not quite sure what I'm doing wrong.

UPDATE.

if
(marker_Type = "Comment")
{marker_Type = "company 1";}
else
(marker_Type = "Chapter")
{marker_Type = "company 2";}

I have try the above code need only comes about company one even though marker type is chapter. So not quite short I am doing wrong here.

Hello, I also tired this:

if

(marker_Type = "Comment")
{marker_Type = "company 1";}
else if
(marker_Type == "Chapter")
{marker_Type = "company 2";}
else
(marker_Type = "FLVCuePoint") 
{marker_Type = "company 3";}


alert(marker_Type);

However, I always get the same result which is Company 3

I have also tried this as well.

switch (marker_Type)
{
case "Comment":
marker_Type = "Company 1";
break;

case "Chapter":
marker_Type = "Company 2";
break;
}

I am sure I am doing something wrong.

Thanks

Arthor
  • 666
  • 2
  • 13
  • 40

1 Answers1

0

The solution was to use a switch statement which worked effectively.

Arthor
  • 666
  • 2
  • 13
  • 40