考考你,能拿满分吗? :) (0分)

  • 主题发起人 savenight
  • 开始时间
S

savenight

Unregistered / Unconfirmed
GUEST, unregistred user!
摘自www.borland.com,别说我侵权呀,[:D]
只摘录了20道,按每道5分算,看看你能得多少分?

1
You have created a form that is very data intensive. You are displaying data
from several tables. This is going to cause your form to be very cluttered in
the designer. How can a DataModule help with this problem?

2
A component is inherited from TControl. Explain how you can have the component
respond to an OnClick event?

3
What are the properties and events of TActionsList?
What are the properties and events of TAction?

4
Why don't you have to create a name property for a component that you create?

5
How can you share the Object Repository?

6
If you change a property of an object on a form, how does Delphi know about
that change when you reload your project?

7
You want to create on object that paints itself on a form. What class could
you inherit from to help you accomplish this task?

8
What component could you use to display all the values in an array in a
spreadsheet format?

9
An application calls for the checking of a registry setting while the
application is running. You do not want to burden the user with this action.
What component could you use to check this variable during the running of the
application?

10
If you did not define a destructor for your TObject descendant, why does it
have one?

11
How can you create an alias that only exists while the application is running?

12
You have a client/server application that uses a TTable with its filter property
set. Is the data going to be filtered at the client or the server?

13
Describe how you would validate data with a TField object and an object that
encapsulates the validation rules for your application?

14
If you only need to view five columns of a table, why would you use a TQuery
and not a TTable?

15
What compiler directives should be used and understood when deploying packages?

16
How can you raise a custom exception that will not display a dialog box to the user?

17
Debugging client server applications can often require debugging across
multiple machines. How does Delphi allow this to be done? What are the
limitations of this feature with respect to operating systems?

18
Which statement is true about deploying a Delphi Enterprise database application?
a You may deploy the BDE royalty free.
b The BDE must be deployed on the client PC.
c A BDE alias must be configured on the client PC.
d The SQL Links must be deployed on the client PC.

19
Which controls can be dropped inside of a TDBCtrlGrid?
a TDBChart
b TDBImage
c TDBGrid
d TDBMemo
e TDBRichEdit
f TDBCombobox

20
Under which condition is the BOF property of a Dataset true?
a The Dataset is closed.
b The Dataset is first opened.
c The record pointer is positioned at the top of the file using the dataset's first method.
d The record pointer is positioned at the bottom of the file using the dataset's last method.
 
关注:E文不好!
 
第一个问题可以这样,DataModule上放上对应的TDATASOUCE,为各个表提供数据。
创建新的事件,当这些TDATASOUCE被修改的时候,激发该事件,从而实现数据敏感

我E文也不好,可能理解错误,请大家指教。问题太多,很累。呵呵,强个先!
 
16题答案是什么?
 
Adnil:
我觉得他的意思好像就是用try except on吧?
 
to savenight
好像不是,它的意思好像是要你自己抛出一个异常,但是这个异常不会用对话框的方式显示
给用户看。

不知道是否是考如何替换全局的异常处理(Application.OnException)
大致代码如下:
....
procedure MyExceptionProc(Sender: TObject; E: Exception);
begin
memo1.lines.add(e.message);
end;
application.onexception := myexceptionproc;
raise exception.create("我自己的异常!");
....
 
Adnil: 不错,你的答案更有道理。[:D]
 
哇,高手!
 
下来TITI
 
这是比较老的一些题目了(针对D5 database),如果您有新的有意思的题目,请公布出来,大家共同探讨,
谢谢![:D]
 
to Adnil, Savenight:
procedure TForm2.Button1Click(Sender: TObject);
begin
raise EAbort.Create('no Message Display');
ShowMessage('Never Show this Message');
end;


不过我觉得这些题目大多都没什么意义。
 
〉〉不过我觉得这些题目大多都没什么意义。
对于这句话,不敢苟同。
也许您是高手,对于您来说没有意义,不过当我看到这些题目的时候,对于我温习以前的知识很有帮助,
而且这时候想到的答案比以前所想到的考虑地更周到一些,所以才贴上来的。

如果您觉得自己可以能拿满分,那可以把您的答案贴出来,让我们这些菜鸟学习学习。[:D]

 
也就是说,只要你的Exception是从EAbort继承下来的就不会显示错误信息了。
 
〉〉也就是说,只要你的Exception是从EAbort继承下来的就不会显示错误信息了。
我觉得您对题目的理解有问题,要单纯是为了不显示错误信息,那么用SetErrorMode是最彻底的,保证任何错误都不会显示。
我个人觉得Adnil的方法比较好。
 
to savenight:
高手也不一定能拿满分,何况我也不是什么高手。 只不过我看到好几题都是需要死记硬背
才能答出来的,就如第三题:What are the properties and events of TActionsList?
What are the properties and events of TAction? 大家用得比较多的应该是OnExecute,
OnUpdate吧,其他什么TActionList.OnChange及TAction.OnHint相信都比较少用到了,这种
题有多大意义呢?很多时候我都以为,只要你要用的时候知道什么地方能找到答案就行了,
而不是要把所有的东西都记下来。
只是个人观点,没有跟人争论的意思。
当然我也非常同意你的看法:对于温习以前的知识很有帮助
 
我倒觉得那个办法并不好,因为你要在你的那个全局Exception Handler下处理所有你的自
定义Exception. 万一有一个未处理呢?异常信息还是Show出来了,看看下面的例子:
type
EMyException = class(EAbort);

procedure TForm2.Button1Click(Sender: TObject);
begin
try
if MyExceptionMustBeRaised then
raise EMyException.Create('no Message Display');
//其它代码
except
on EMyException do
ShowMessage('Custom Exception Raised.');
//你可以在此处理你的异常,也可以完全不理它,都不会报错给用户
end;
ShowMessage('Never Show this Message when EMyException not handled.');
end;
 
顶部