IFSM247 – Introduction to PowerBuilder
Quiz #2
1. Which of the following controls would you use when
only one choice is appropriate? for selecting options?
2. A developer wants to execute the code attached to the
clicked event of a command button. The
button is named cb_save. Which of the
code statements are valid?
A. clicked!cb_save.TriggerEvent()
B. exec cb_save.TriggerEvent(Clicked!)
C. run cb_save.TriggerEvent()
D. cb_save.TriggerEvent(clicked!)
3. Which of the following are valid variable names?
A. 1_variable_name
B. variable_name_1
C. $_total_dollar_value
D. percent_%
4. The developer wants to use a command button to append
the text property of a single-line-edit with the string “7”. Which of the following code segments could
accomplish this.
A. sle_display = sle_display + 7
B. sle_display.text = sle_display.text + 7
C. sle_display.text = sle_display.text + this.text
D. sle_display.text = sle_display.text + “7”
5. From within the Integrated Development Environment
(IDE), which means inside of PowerBuilder, you try to run the application. You see a message box with the following
message: “This application needs a script for its open event”. Which code segment/location pair would
correct this problem?
A. Open(w_main) in the application open event
B. Open(w_main) in the w_main open event
C. Open(w_main) in the w_main constructor event
D. Adding code would not correct this problem.
6. In the line of code, lb_city.SelectedText(),
SelectedText() refers to a(n):
A. function
B. property
C. object
D. event
7. In the line of code, lb_city.Text(5), 5 is:
A. an argument to the text function
B. a reference to the index of the listbox
C. a variable
D. the state of the index item
8.
The default window
created by the Windows painter is a:
A. Child Window
B. Main Window
C. PopUp Window
D. Response Window
9. To define a menu shortcut key, you precede the
shortcut letter with which symbol:
A. ^
B. %
C. &
D. –
10. There are two windows open in an application, Window
A and Window B. When the user presses a
command button on Window B, some text should be set in a single line edit
control on Window A. Which of the
following code segments would accomplish this task?
A. w_window_a.sle_display.text = “Some text”
B. sle_display.text = “Some text”
C. sle_display.text(TriggerEvent) = “Some text”
D. TriggerEvent(w_window_a.SetText(“Some text”)
True or False
11. _____ You should always allow PowerBuilder to
generate an application framework when creating an application object.
12. _____ You will get an error if the application object
has the same name as the pbl filename.
13. _____ In the code segment, cb_exit.text, text is an
event.
14. _____ For counter = 1 to len(sle_password.text) is a
valid way to begin a for loop
15. _____If a window is open, it must be visible.
16. _____ A response window is an example of a modal
window.
17. _____ Every if statement must have an end if
18. _____ A function can return multiple data items.
19. _____ In PowerBuilder arguments to functions are
usually passed by value.
20. _____ Menus are attached to windows using the windows
painter.