何时使用“。”何时使用“!” [英] When to use "." and when to use "!"

查看:76
本文介绍了何时使用“。”何时使用“!”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我仍然对此感到困惑,我无法在任何地方找到正确的解释




我有MS书 ; Access 2003在我面前,我正在阅读关于VB的第5部分

等等。它告诉我如何引用特定的

数据库并举例: -


Dim dbMyDb作为DAO.Database

设置dbMyDb = DBEngine.Workspaces(0).Databases(0)


但是,但是,但是 - 那些点(句点,句号,调用

他们会是什么意思? (好吧,在引用类/结构成员时,它看起来和

C / C ++ / Java的用法相同,但是我希望它可以告诉我某个地方的b $ b)


为什么在这种情况下引用对象成员时会使用点

但是当引用表单上的控件时(例如),使用! ;。


肯定有一个地方可以帮助人们理解这个基本的

语法。


-

Chris Green

I''m still confused about this and I can''t find anywhere that explains
it properly.

I have the MS book "Access 2003" in front of me and I''m reading Part 5
about VB and so on. It''s telling me about how to refer to a specific
database and has the example:-

Dim dbMyDb As DAO.Database
Set dbMyDb = DBEngine.Workspaces(0).Databases(0)

but, but, but, but - what do those dots (periods, full stops, call
them what you will) mean? (OK, it appears to be the same usage as
C/C++/Java when referring to class/structure members, but I wish it
would tell me that somewhere)

Why are there dots used in referring to object members in this case
but when referring to controls on forms (for example) one uses "!".

Surely there must be somewhere that helps one understand this basic
syntax.

--
Chris Green

推荐答案

通常,一个点暴露属性和方法,一个爆炸(!)暴露

集合的成员。所以表格!frmMyForm.Visible是指frmMyForm的

可见属性,它是表格

集合的成员。是什么让这更难(或更容易,取决于你的b
透视)来理解,Access已经越来越多地使用错误的符号。

Generally, a dot exposes properties and methods and a bang (!) exposes
members of a collection. So forms!frmMyForm.Visible refers to the
visible property of frmMyForm, which is a member of the forms
collection. What makes this harder (or easier, depending on your
perspective) to grasp, is that Access has gotten more and more
forgiving about using the "wrong" notation.


us****@isbd.co .uk 在新闻中写道:44316bba.0@entanet:
us****@isbd.co.uk wrote in news:44316bba.0@entanet:
我仍然对此感到困惑,我无法找到解释的地方
它正确。

我有MS书Access 2003。在我面前,我正在阅读关于VB的第5部分
等等。它告诉我如何引用特定的数据库,并举例说明: -

Dim dbMyDb作为DAO.Database
设置dbMyDb = DBEngine.Workspaces(0 )。数据库(0)
但是,但是,但是,但是 - 这些点(句号,句号,打电话给你们想要的)是什么意思? (好吧,在引用类/结构成员时它看起来与使用C / C ++ / Java的用法相同,但是我希望它能告诉我某个地方)

为什么在这种情况下引用对象成员时会使用点?
但是当引用表单上的控件时(例如),则使用!。

当然必须有某个地方帮助我们理解这个基本的语法。
I''m still confused about this and I can''t find anywhere that explains
it properly.

I have the MS book "Access 2003" in front of me and I''m reading Part 5
about VB and so on. It''s telling me about how to refer to a specific
database and has the example:-

Dim dbMyDb As DAO.Database
Set dbMyDb = DBEngine.Workspaces(0).Databases(0)

but, but, but, but - what do those dots (periods, full stops, call
them what you will) mean? (OK, it appears to be the same usage as
C/C++/Java when referring to class/structure members, but I wish it
would tell me that somewhere)

Why are there dots used in referring to object members in this case
but when referring to controls on forms (for example) one uses "!".

Surely there must be somewhere that helps one understand this basic
syntax.




我总是使用。


它总是有效。


-

Lyle Fairfield



I always use .

It always works.

--
Lyle Fairfield


us **** @ isbd.co.uk 写道:
我仍然对此感到困惑,我找不到任何解释<它是正确的。

我有MS书Access 2003。在我面前,我正在阅读关于VB的第5部分
等等。它告诉我如何引用特定的数据库,并举例说明: -

Dim dbMyDb作为DAO.Database
设置dbMyDb = DBEngine.Workspaces(0 )。数据库(0)
但是,但是,但是,但是 - 这些点(句号,句号,打电话给你们想要的)是什么意思? (好吧,在引用类/结构成员时它看起来与使用C / C ++ / Java的用法相同,但是我希望它能告诉我某个地方)

为什么在这种情况下引用对象成员时会使用点?
但是当引用表单上的控件时(例如),则使用!。

当然必须有某个地方帮助人们理解这种基本的语法。
I''m still confused about this and I can''t find anywhere that explains
it properly.

I have the MS book "Access 2003" in front of me and I''m reading Part 5
about VB and so on. It''s telling me about how to refer to a specific
database and has the example:-

Dim dbMyDb As DAO.Database
Set dbMyDb = DBEngine.Workspaces(0).Databases(0)

but, but, but, but - what do those dots (periods, full stops, call
them what you will) mean? (OK, it appears to be the same usage as
C/C++/Java when referring to class/structure members, but I wish it
would tell me that somewhere)

Why are there dots used in referring to object members in this case
but when referring to controls on forms (for example) one uses "!".

Surely there must be somewhere that helps one understand this basic
syntax.



好​​了Access 2003这本书。实际上它确实在

相同的章节进一步解释了 - 我应该继续阅读。然而,在解释它之前,使用这样的语法似乎已经向我反击了。


Mumble,mumble,moan,moan .......: - )


-

Chris Green


Well the book "Access 2003" does actually explain it further down the
same chapter - I should have kept reading. However it does seem
backwards to me using syntax like this before explaining it.

Mumble, mumble, moan, moan....... :-)

--
Chris Green


这篇关于何时使用“。”何时使用“!”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆