MyPage is a personalized page based on your interests.The page is customized to help you to find content that matters you the most.


I'm not curious

Log Errors in PowerBuilder

Published on 01 September 16
1089
0
1
// In application object's SystemError event write the below code

int li_filehandle

li_filehandle=FileOpen("Error.log",Linemode!,Write!,LockWrite!,Append!)
FileWrite(li_filehandle,String(Error.Number))
FileWrite(li_filehandle,Error.text )
FileWrite(li_filehandle,Error.windowmenu)
FileWrite(li_filehandle,Error.object)
FileWrite(li_filehandle,Error.Objectevent)
FileClose(li_filehandle)

// When you get an error while running the application, you can see the error details in the log file present in the application exe path
// You can manually raise an error using SignalError
// Add the below code to a button '

error.number=2
error.text="This is a defined error"
error.object="Button Object"
Error.objectevent="Clicked Event"
Error.windowmenu="This window Don't have menu"
// It is like raise error in SQL
signalerror()
MessageBox("Check Log file","Please check the log file for the error details")
When you click the button - my log file will have the below data
Log Errors in PowerBuilder - Image 1




// In application object's SystemError event write the below code

int li_filehandle

li_filehandle=FileOpen("Error.log",Linemode!,Write!,LockWrite!,Append!)

FileWrite(li_filehandle,String(Error.Number))

FileWrite(li_filehandle,Error.text )

FileWrite(li_filehandle,Error.windowmenu)

FileWrite(li_filehandle,Error.object)

FileWrite(li_filehandle,Error.Objectevent)

FileClose(li_filehandle)

// When you get an error while running the application, you can see the error details in the log file present in the application exe path

// You can manually raise an error using SignalError

// Add the below code to a button '

error.number=2

error.text="This is a defined error"

error.object="Button Object"

Error.objectevent="Clicked Event"

Error.windowmenu="This window Don't have menu"

// It is like raise error in SQL

signalerror()

MessageBox("Check Log file","Please check the log file for the error details")

When you click the button - my log file will have the below data

Log Errors in PowerBuilder - Image 1

This blog is listed under Development & Implementations Community

Related Posts:
Post a Comment

Please notify me the replies via email.

Important:
  • We hope the conversations that take place on MyTechLogy.com will be constructive and thought-provoking.
  • To ensure the quality of the discussion, our moderators may review/edit the comments for clarity and relevance.
  • Comments that are promotional, mean-spirited, or off-topic may be deleted per the moderators' judgment.
You may also be interested in
Awards & Accolades for MyTechLogy
Winner of
REDHERRING
Top 100 Asia
Finalist at SiTF Awards 2014 under the category Best Social & Community Product
Finalist at HR Vendor of the Year 2015 Awards under the category Best Learning Management System
Finalist at HR Vendor of the Year 2015 Awards under the category Best Talent Management Software
Hidden Image Url

Back to Top