Change Error in SubString Command behaviour?

General Macro Scheduler discussion

Moderators: JRL, Dorian (MJT support)

Post Reply
rullbandspelare
Pro Scripter
Posts: 149
Joined: Tue Mar 23, 2004 9:11 pm

Change Error in SubString Command behaviour?

Post by rullbandspelare » Wed Sep 19, 2012 7:34 pm

Hi!
This gives "Error in SubString Command"
Let>Name=
MidStr>%Name%,6,3,Surename
Why? Shouldnt it just give Surename=
This forces me to make an if>Name= before the MidStr.
Can I override this beahviour in another way.

This Works:
Let>Name=John Doe
MidStr>%Name%,6,3,Surename

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Sep 20, 2012 7:41 am

Because Name is zero length, so there's no 6th char.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

rullbandspelare
Pro Scripter
Posts: 149
Joined: Tue Mar 23, 2004 9:11 pm

Post by rullbandspelare » Thu Sep 20, 2012 1:52 pm

But then this also should give an error:

Let>Name=J
MidStr>%Name%,6,3,Surename

But it doesnt!

It should be realy convenient if it was possible to configure it NOT to throw an error if the input variable is empty. Now I allways have to check so that it is not empty.


Thanks!

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Sep 20, 2012 1:53 pm

Fair point. They should be consistent. Noted.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts