Home > Community > Forums > Custom IC SKILL > pop up for a program error

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 pop up for a program error 

Last post Tue, Oct 9 2012 10:15 AM by KKANDOTH. 2 replies.
Started by KKANDOTH 03 Oct 2012 06:49 PM. Topic has 2 replies and 632 views
Page 1 of 1 (3 items)
Sort Posts:
  • Wed, Oct 3 2012 6:49 PM

    • KKANDOTH
    • Not Ranked
    • Joined on Thu, May 5 2011
    • Posts 8
    • Points 130
    pop up for a program error Reply

     Hi All,

     I want to build a program which has a user alert facility as soon as it find some error while executing. For example if there is a program like this  

    procedure(testing()

    a = "try"

    b = 2

    c=a*b

    )  This program will find an error at line c = a*b. and throw a *ERROR ..... message in icfb.log. I want to have a pop up window which alert the user as soon as it exit. I am using a try1=errset(testing) now. According to try1 value , (t or nil) i can find if the program executed or not. but it will suppress the error message in ICFB.log

     Thank You,

    Krishnan
    • Post Points: 20
  • Wed, Oct 3 2012 10:32 PM

    Re: pop up for a program error Reply

    Krishnan,

    This does what you want:

    procedure(myErrorHandler(info)
      hiDisplayAppDBox(
       ?name 'myErrorDialog
       ?dboxBanner "Error occurred"
       ?dboxText info
       ?dialogType hicErrorDialog
       ?buttonLayout 'Close
       ?dialogStyle 'modal
      )
    )

    ilAddTopLevelErrorHandler('myErrorHandler)

    By the way, if you use errset, you can either pass t as the second argument to errset, and then it will still print the error message. Or you can get the message info by accessing errset.errset . For example:

    errset(testing() t)
    *Error* times: can't handle ("try" * 2)

    unless(errset(testing())
      printf("GOT THIS: %L\n" errset.errset)
    )

    GOT THIS: ("times" 0 t nil ("*Error* times: can't handle (\"try\" * 2)"))

    You can find out more on errset.errset in the documentation for errset().

    Regards,

    Andrew.

     

     

    • Post Points: 20
  • Tue, Oct 9 2012 10:15 AM

    • KKANDOTH
    • Not Ranked
    • Joined on Thu, May 5 2011
    • Posts 8
    • Points 130
    Re: pop up for a program error Reply

     Hi Andrew,

     

    Thank You very much for your help. " errset(testing() t) " solved all my problems

     

    Thank You,

    Krishnan

    • Post Points: 5
Page 1 of 1 (3 items)
Sort Posts:
Started by KKANDOTH at 03 Oct 2012 06:49 PM. Topic has 2 replies.