|
Advanced PowerBuilder ExercisesWrite a function to log 'login time' and 'log out time' for each user, in a database table and implement it. We don't have a table to store the login and logout information. You need to create that table also. So, design and create the table.
|
Tip: |
You can create two functions to log the above specified details, one to log login info and another to log logout info. You can create these functions at uo_transaction user object. |
|
Solution: |
ex-13-1.zip |
Create a class user object, inheriting from the Error class. Implement a function to save the error information to a specified error file. Use this in the application, instead of Error object. Use this newly created function from "Save to Log".
|
Tip: |
You can copy code written to 'Save to Log' CommandButton in the w_error window and modify it and put in the written function. |
|
Solution: |
ex-13-2.zip |
This exercise would be interesting. Recall that we placed five SingleLineEdit controls in the w_login window. For each control, we wrote script in the GotFocus and LoseFocus events, to display help on the st_help StaticText control (recall that st_help is located in the w_login window). What we want you to do is, create an user object uo_sle of type SingleLineEdit control and write script in those events, to display help on the st_help control. Once you create uo_sle, replace all SingleLineEdit controls in the w_login window, with uo_sle. The challenging part of this exercise is that, you can't directly refer to st_help from the user object uo_sle, because, st_help is not part of uo_sle, it is part of w_login window.
|
Tip: |
You can create an instance variable of type StaticText control in uo_sle and assign st_help to that instance variable from outside, may be from w_login window's open event. |
|
Solution: |
ex-13-3.zip |
|