ExecuteCommand Multiple Lines

Post Reply
PlanningDev
Community Contributor
Posts: 349
Joined: Tue Aug 17, 2010 6:31 am
OLAP Product: Planning Analytics
Version: 2.0.5
Excel Version: 2016

ExecuteCommand Multiple Lines

Post 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?
rmackenzie
MVP
Posts: 733
Joined: Wed May 14, 2008 11:06 pm

Re: ExecuteCommand Multiple Lines

Post 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 );
Robin Mackenzie
lotsaram
MVP
Posts: 3706
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: ExecuteCommand Multiple Lines

Post 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
rmackenzie
MVP
Posts: 733
Joined: Wed May 14, 2008 11:06 pm

Re: ExecuteCommand Multiple Lines

Post 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:
Robin Mackenzie
Post Reply