Do you know that? Frequently use a to-do list. next

Contact Email:

<< All Upwork (oDesk) and Elance Tests << Upwork (oDesk) test answers << General Programming category

Test answers for Delphi 6 Test 2020

(50, CL) Last updated: September 14
Upwork (oDesk) • General Programming
Questions and answers are regularly updated. Answered and not answered tests questions.

This helps getting job: Hundreds of (cover letter examples , interview questions , profile samples ) • Earn on Upwork (oDesk)
Job assistance: jobs popularityfreelance rates

Popular test answers: HTML, .Net, CSS, English, SEO, Photoshop, iOS, Java, Android, Ruby, Python, JavaScript

See all 6 tests answers updated

Find Upwork (oDesk) and Elance test answers on this website:

Collapse | Expand

50 Answered Test Questions:

1. Which of the following are the valid DeviceType property values for the TMediaPlayer component?


• dtAutoSelect

• dtMP3

• dtExternalDevice

• dtAudio

• dtTV

• dtMPEG3

• dtDAT

• dtDigitalVideo

2. Which of the following are valid identifier names for a variable?


• Cust_no5

• Cust no5

• 5Cust_No

• cUSTNo

• custno 5

• cust&no

3. TDataSet is a base class from which other database components are inherited to encapsulate which database object(s)?


• A Table

• A Trigger

• A Field

• A Query

• A DBAware Component

• A Stored Procedure

4. Which of the following will add text to a TMemo component called Memo1?


• Memo1.Lines.Add('Text');

• Memo1.AddLine('Text');

• Memo1.Lines.Include('Text');

• Memo1.Lines.Append('Text');

5. What component is used to link two datasets in a master/detail relationship?


• TTable

• TDataSource

• TMasterDetail

• TDatabase

6. Which of the following will link a TUpDown control named UpDown1 with an Edit box named Edit1, allowing the TUpDown control to modify the values in the Edit box?


• UpDown1.Associate := Edit1;

• UpDown1.Link := Edit1;

• UpDown1.Link(Edit1);

• Link(UpDown1,Edit1);

7. What is the purpose of the "Break" procedure?


• It causes the flow of control to exit the current function or procedure and execute the next logical code statement

• It causes the current thread to suspend execution to allow other threads to operate

• It simulates the user pressing the Break key on the keyboard

• It causes the flow of control to exit a loop and continue at the next statement following the loop

8. For a TQuery component called Query1 with SQL of "Select * from Student Where Number=500", which of the following is the correct method to run the query?


• Query1.Active:=True;

• Query1.RunSQL;

• Query1.ExecuteAction(SQL);

• Query1.ExecSQL;

9. What does the Cancel property of the TButton object do?


• It automatically displays Cancel as the button caption

• It determines if the button's OnClick event handler is called when the Escape key <Esc> is pressed on the keyboard

• It calls the parent forms' OnClose event

• It causes a popup menu to be displayed when the button is clicked which permits the user to select Cancel

10. Which property of TBitBtn allows you to specify what image to display on the button?


• BitBtn1.CaptionImage

• BitBtn1.Image

• BitBtn1.Glyph

• BitBtn1.Picture

11. What is the value of the variable int_temp after the for loop has ended in the code shown?


• 1

• 2

• 5

• The value of int_temp is undefined

12. Which of the following will connect a DataSource to a Table where the Datasource component is call DataSource1 and the Table component is called Table1?


• DataSource1.Table:=Table1;

• DataSource1.DataSet:=Table1;

• DataSource1.Source:=Table1;

• DataSource1.SetTable(Table1);

13. Which of the following is a event of TPanel?


• OnClose

• OnExit

• OnTerminate

• OnDoubleClick

14. Given the code "Edit1.Hint := 'Customer Name|Enter Customer Name in the edit box';", which of the following is the correct code to retrieve the text after the | character, i.e. "Enter Customer Name in the edit box", when the OnHint handler is called?


• GetLongHint(Application.Hint);

• GetHint(Application.Hint);

• GetShortHint(Application.Hint);

• GetSecondHint(Application.Hint);

15. Which three properties of TProgressBar are responsible for setting the minimum, maximum and current position for the control?


• Maximum, Minimum & Percentage

• Maximum, Minimum & Position

• Max, Min & Position

• Max, Min & Pos

16. What does the code shown do?


• Creates an array to store two Integers

• Creates an array to store two Variants

• Creates an array to store one hundred Integers

• Creates an array to store ninety nine Integers

17. What happens if the TreeView1.Items list is empty when the code "TreeView1.Items.AddFirst(TreeView1.Items[0],'X');" is executed?


• An X appears as the top most node in the TreeView

• An "Index is out of bounds" error message is displayed

• An ETreeViewError exception is raised with the message 'Invalid Index'

• An X appears as a sub node to the first node in the TreeView

18. Given a TPageControl component called PageControl1 with three TabSheets called TabSheet1, TabSheet2 and TabSheet3 (in that order), which of the following will make TabSheet2 selected?


• PageControl1.TabIndex:=1;

• TabSheet2.Show;

• PageControl1.ShowTab(TabSheet2);

• PageControl1.VisibleTab:=TabSheet2;

• TabSheet2.Click;

• TabSheet2.Select(PageControl1);

19. Given that x and y are variables declared as type Char, which of the following is NOT a valid Pascal assignment statement?


• x := y;

• x := Char(Ord(Y)+1);

• x := Char(#22);

• x := y + #22;

20. Which of the following is the correct code to cause a popup menu named Popupmenu1 on a form called Form1 to be displayed?


• Application.DisplayMenu(Form1.Popupmenu1);

• Form1.Popupmenu1.Popup(20,30);

• Form1.Popupmenu1.ShowMenu;

• Form1.ShowMenu(Popupmenu1);

21. How does a TRichEdit differ from a TMemo?


• TRichEdit prevents users from overwriting existing text, whereas TMemo does not

• TRichEdit allows saving directly to text files, whereas TMemo does not

• TRichEdit prevents font attributes from being changed by the user, whereas TMemo does not

• TRichEdit allows font attributes to be set, whereas TMemo does not

22. Which of the following is the correct method to activate a modal open dialog box when using the TOpenDialog component?


• OpenDialog1.OpenFile;

• OpenDialog1.GetFile;

• OpenDialog1.Filename;

• OpenDialog1.Execute;

23. Which of the following is the correct code to create an object from class TMainForm?


• Form.Create(TMainForm);

• Application.CreateForm(TMainForm, MainForm);

• TMainForm.CreateForm(MainForm);

• MainForm:=Application.CreateFormInstance(TMainForm);

24. What files end with the .dpk extension?


• Unit Source files

• Project Source files

• Package Source files

• Delphi Library

25. What is the main difference between TLabel and TStaticText?


• TStaticText has a Window Handle and can accept focus whereas TLabel does not have a Window Handle and cannot accept focus

• TStaticText allows the user to edit the text displayed whereas TLabel does not allow the user to edit the text displayed

• TLabel's caption property can be changed programmatically whereas TStaticText's Caption property cannot be changed programmatically

• TLabel does not have a ShowAccelChar property whereas TStaticText does have a ShowAccelChar property

26. Which of the following changes a TDBNavigator component called DBNavigator1 so that it only displays navigation buttons?


• DBNavigator1.VisibleButtons := [nbFirst,nbLast,nbPrior,nbNext];

• DBNavigator1.NavigationOnly := True;

• DBNavigator1.Buttons := [nbFirst,nbLast,nbPrior,nbNext];

• DBNavigator1.Constraints := [nbFirst,nbLast,nbPrior,nbNext];

27. Which of the following retrieves the value from the SNumber field as a string for the current record in an open Table called Table1?


• Table1.Field.SNumber.AsString;

• String(Table1.Fields('SNumber'));

• Table1.FieldByName('SNumber').AsString;

• Table1.Items.String('SNumber');

28. What value is displayed on screen when the procedure test is called?


• 5

• 13

• 8

• 3

29. What is the purpose of the Alignment Palette?


• To change the order or position of the components in the Visual Component Library

• To align the main IDE Windows to each other

• To align components to the form, or with each other

• To set the alignment property of any components on a form

30. Which of the following would cause all the items in a RadioGroup to be appended so that all items appear twice?


• Radiogroup1.Items.Duplicate;

• Radiogroup1.Append(Radiogroup1);

• Radiogroup1.Items.Append(rgALL);

• Radiogroup1.Items.AddStrings(Radiogroup1.Items);

31. Which of the following is the correct code to cause a form named Form1 to be displayed as modal?


• Form1.Show;

• ShowModal(Form1);

• Form1.ModalResult:=mrOk

• Form1.ShowModal;

32. Which of the following is the correct code to "tick" a TCheckBox component called CheckBox1 as shown?


• CheckBox1.Checked:=True;

• CheckBox1.Ticked:=True;

• CheckBox1.Tick(True);

• CheckBox1.Enabled:=True;

33. What does the TDBLookupComboBox component do?


• It allows a field value to be selected from a TList object specified by the programmer

• It performs a search for a field with the same name as the text entered

• It allows the selection of a database from a list of those found on a network

• It identifies a set of field values in one dataset with a corresponding set of values from another dataset

34. From the code shown, how many times would the ShowMessage procedure be called if the button in question was clicked three (3) times?


• 0

• 1

• 2

• 3

35. In the code shown, TMyClass inherits from which parent class?


• TApplication

• TObject

• Inheritance does not take place

• TMyClass

36. Which of the following removes the SQL statement from a TQuery component called Query1?


• Query1.SQL.Delete;

• Query1.Delete(SQL);

• Query1.SQL.Clear;

• Query1.Enabled:=False;

37. What does the code shown do?


• Loads the number 1 into the DH register

• Loads the number 1 into the dh variable

• Loads the character '1' into the dh variable

• Loads the value in the dh variable into the DH register

38. Which of the following is NOT an event of the TApplicationEvents component?


• OnActionExecute

• OnBusy

• OnMessage

• OnHint

• OnException

• OnSettingChange

39. When will the code "Application.Terminate;" be executed in the code shown?


• When the user presses the Cancel button

• Every time the procedure is executed

• When the user presses the Ok button

• Never

40. What is the purpose of the AutoMerge property in the TMainMenu component?


• It determines if main menus of secondary forms merge with the main menu of the main form in non-MDI applications at runtime

• It determines if sub menu items are automatically merged with the parent menu items if there is only a single sub menu item

• It determines if the main menu items can be automatically resized at runtime so that they provide a "best fit" in a resizable form

• It determines if the TMainMenu component can correct menu item short cut key conflicts with existing Windows short cut keys

41. What is the shortcut key for manually displaying the code completion window while entering code?





• CTRL + Page Down

42. The TTimer component has a property which determines how frequently the OnTimer event occurs.  Which of the following is that property and what does the property measure?


• Property: Time, Measured in: Seconds

• Property: Timer, Measured in: Hundreds of a second (1/100 Sec)

• Property: Interval, Measured in: Milliseconds (1/1000 Sec)

• Property: Tick, Measured in: Clock Ticks

43. Given a ComboBox named ComboBox1 and an Edit box named Edit1, which of the following is the correct code to add the information in the Edit box to the drop down list in the ComboBox?


• ComboBox1.Items.Add(Edit1.Text);

• ComboBox1.Strings := ComboBox1.Strings + Edit1.Text;

• ComboBox1.List.AddItem(Edit1.Text);

• ComboBox1.Append(Edit1.Text);

44. Which of the following properties when set to True, enables an application to gain sole access to a database?


• TDatabase.OthersReadOnly

• TDatabase.KeepConnection

• TDatabase.Params

• TDatabase.Exclusive

45. What is the purpose of Code Templates?


• To provide easy access to commonly used programming statements

• To allow the creation of Document Templates from existing source code

• To provide easy access to Native Databases without using components

• To allow the conversion of selected code to a procedure

46. What does the procedure shown do?


• It moves the contents of the file c:\autoexec.bat to the file c:\outfile.txt

• It moves the contents of the file c:\outfile.txt to the file c:\autoexec.bat

• It copies the contents of the file c:\autoexec.bat to the file c:\outfile.txt

• It copies the contents of the file c:\outfile.txt to the file c:\autoexec.bat

47. What is the purpose of the TDataModule?


• To provide a login to a secured or an encrypted database

• To provide a temporary storage area of query results

• To provide a location for centralized handling of non-visual components

• To provide a connection to a remote database server

48. What is the purpose of the AlphaBlend property of TForm?


• It specifies the background color of the form

• It specifies if the form is translucent or not

• It specifies if the form is available for drawing on via TCanvas

• It specifies the redrawing speed of the form

49. What is the purpose of the Initialization section of a Unit?


• It contains assembly code that is executed on PC startup

• It contains statements that are executed on unit start up

• It contains Window handling code

• It contains program management code and should not be edited directly by a programmer

50. Which key toggles between the Object Inspector and the Edit Window / Form?


• ALT + O

• F11

• F4