Page 1 of 1

ExecuteCommand Multiple Lines

Posted: Tue Dec 18, 2012 6:24 am
by PlanningDev
Is it possible to execute more than one line using ExecuteCommand?

For instance, if you wanted to insert a sleep command in front of something else?

Re: ExecuteCommand Multiple Lines

Posted: Tue Dec 18, 2012 6:55 am
by rmackenzie
PlanningDev wrote:Is it possible to execute more than one line using ExecuteCommand?
You can use & and && to use multiple commands. Using && will mean that the first command has to be successful for the next one to work. E.g.

Code: Select all

sCommand = 'cmd /c type tm1s.cfg > temp1.txt && dir > temp2.txt';
ExecuteCommand ( sCommand, 0 );
Assuming tm1s.cfg is in your data directory then check for temp1.txt and temp2.txt in your data directory; otherwise neither of them should be there.
PlanningDev wrote:For instance, if you wanted to insert a sleep command in front of something else?
Are you aware that TM1 has a sleep command - it isn't documented. The usage is:

Code: Select all

nMilliseconds = 10000;
Sleep ( nMilliseconds );

Re: ExecuteCommand Multiple Lines

Posted: Tue Dec 18, 2012 12:08 pm
by lotsaram
rmackenzie wrote:Are you aware that TM1 has a sleep command - it isn't documented. The usage is:

Code: Select all

nMilliseconds = 10000;
Sleep ( nMilliseconds );
Nope! Another undocumented nugget like break

Re: ExecuteCommand Multiple Lines

Posted: Tue Dec 18, 2012 1:40 pm
by rmackenzie
lotsaram wrote:Nope! Another undocumented nugget like break
Hey, lotsa... you should check out the difference between this, this and this... and this and this.
Then... if you can crack the undocumentedness then perhaps you'll be able to tell us how to do this and this in rules! ;)

I guess our TM1 friends at IBM have a lot of this! It's something a lot of us are probably guilty of though :oops: