BlockInput /SDK

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
SteenJakobsen
Pro Scripter
Posts: 110
Joined: Thu Apr 08, 2010 6:11 am
Location: Hørsholm, Denmark
Contact:

BlockInput /SDK

Post by SteenJakobsen » Sun Oct 31, 2010 7:52 pm

Hi all,

When i use BlockInput and and do something illegal in the script (se example)
then the user is presented with af dialog box saying that there is an error.
the user can not click the OK button due to the fact that BlockInpit is enabled.
How can I trap that kind of error in for example an exception routine or something like that and unlock the keyboard ? Or even better somehow in the SDK funcion get the error as a return value ? (Then I can handle it my self and make a cleaner implemtation. :-) )

Also : in the AcrtiveX implenttion there is a STOP function. Is the same function avalible in the DLL?

Code: Select all

BlockInput>1
GoSub>SRTThatDoesNotExist
Best Regards
Steen Jakobsen
DM Software A/S

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

Post by Marcus Tettmar » Tue Nov 02, 2010 12:29 pm

Use IGNOREERRORS to trap errors rather than display them.

NEVER use BlockInput until you are sure the script is working fine. If you do get stuck you should be able to get out by hitting CTRL-ALT-DEL.

Yes, there is a Stop function but I notice now that it is not documented. Definition:

function Stop: integer; stdcall;

I.e. returns an integer. No parms. Returns zero if successful.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

SteenJakobsen
Pro Scripter
Posts: 110
Joined: Thu Apr 08, 2010 6:11 am
Location: Hørsholm, Denmark
Contact:

Post by SteenJakobsen » Tue Nov 02, 2010 12:48 pm

Thanks Marcus,

When ignoreerors=1
Does The macro then terminate when an error is detected? and if not how Can I trap the error and terminate The script?
Best Regards
Steen Jakobsen
DM Software A/S

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

Post by Marcus Tettmar » Tue Nov 02, 2010 2:16 pm

In this case yes, the subroutine doesn't exist so the script halts.

Functions that have return values generally return the error there. So those would be trappable.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

SteenJakobsen
Pro Scripter
Posts: 110
Joined: Thu Apr 08, 2010 6:11 am
Location: Hørsholm, Denmark
Contact:

Post by SteenJakobsen » Wed Nov 03, 2010 5:30 am

Ok .. Your reply sounds like it is not all errors that can be trapped.

Can you advise me a general vay to trap errorts and repport
to the user whar is wrong and what line number ?

Thanks in advance..

By the way .. the SDK works relally really well for me .. :-)
Best Regards
Steen Jakobsen
DM Software A/S

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

Post by Marcus Tettmar » Wed Nov 03, 2010 6:51 am

I'm afraid there is no way beyond what it does already - the SDK doesn't change the behaviour of the script engine. So right now you just have to rely on the usual pop up errors which show the error message and the line number. You can only suppress those errors with the IGNOREERRORS directive but then you can check result of some functions (e.g. FTP function) but others like the missing subroutine will just terminate the script.

The ability to define a custom error handler is on the wish list for a future version.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

SteenJakobsen
Pro Scripter
Posts: 110
Joined: Thu Apr 08, 2010 6:11 am
Location: Hørsholm, Denmark
Contact:

Post by SteenJakobsen » Wed Nov 03, 2010 7:00 am

Hi Marcus,

Would it be possible to get the error message returned in the SDK RunCode() function. and maybe an option to always terminate the script if any error happens.
That will make the error handeling just great.

My problem is that there is no way a doctor or banking person is able to "survive" a script error and it generates huge amounts of support when something goes wrong..

If you need funding for the task I'm willing to donate :-)
Best Regards
Steen Jakobsen
DM Software A/S

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

Post by Marcus Tettmar » Wed Nov 03, 2010 8:27 am

It's not a trivial change and requires a change to the core product first. Not normally something we could easily add to the current branch and scheduled for the next major version (so probably sometime next year).

But we might be able to consider a custom modification if this is something you need quickly. Assuming we have the time. Email me off list if you want to discuss that.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

SteenJakobsen
Pro Scripter
Posts: 110
Joined: Thu Apr 08, 2010 6:11 am
Location: Hørsholm, Denmark
Contact:

Post by SteenJakobsen » Wed Nov 03, 2010 9:39 am

Ok marcus I understand,

I'll wait the next 8 weeks and se how the project progresses. And If it gets critical then I'll contact you.

Thanks again for your always constructive feedback.
Best Regards
Steen Jakobsen
DM Software A/S

sawert
Newbie
Posts: 1
Joined: Tue Jan 18, 2011 5:31 am

Post by sawert » Sat Jan 22, 2011 5:53 am

This post just went way above my head and I have no idea how I am going to decipher what you have just said. Could you please explain what it means to block input and what exactly you want? Do you want the box or do you want to block input?

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