I am trying to print out a command that has been added via the command.AddlLine method.
I have a method that works see DOpus output Ref 010-020. Fancy method using an enumerator.
I want a simpler way knowing that I only have a single command added and I have tried using the command.CommandList method but it is not working. See ref 010-030 below.
What am I doing wrong? I know the command.CommandList method returns a StringSet object.
This does not seem to be the way to do it.
Apart from the working enumerator method (Ref 010-020) is there a simpler way of printing out the single command that has been added?
Thanks as always
function OnClick(clickData)
{
DOpus.ClearOutput;
DOpus.Output("001-000 Start");
var cmd = clickData.func.command
//
cmd.AddLine("Clipboard SET AAAAAA");
DOpus.Output(" 010-000 cmd.Linecount = " + cmd.Linecount);
for (var eSel = new Enumerator(cmd); !eSel.atEnd(); eSel.moveNext())
{
DOpus.Output(" 010-020 --> " + eSel.item());
}
DOpus.Output(" 010-030 cmd.CommandList : " + cmd.CommandList.count);
cmd.run()
}
Thanks for reply @errante - you may have noticed cmd.linecount is outputted above and I get a single number 1 (one). I assumed that was the number of commands currently loaded?
Sorry, I misread your question. It seems you want to get the content of all the lines you added to cmd? I don't think that's possible, and since they are added manually, it doesn't seem to make much sense to me.
If you want to see how many lines you added to cmd, you can do it without the for, with cmd.linecount
Yes that is correct. I want to check what I have loaded to make sure it is correct.
I think there is probably only one way that is enumerate and cmd object as above....
Thanks anyway