不满意的语法 [英] Unsatisfying syntax

查看:67
本文介绍了不满意的语法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在朋友的帮助下(那就是你)我成功写了一个

小程序。


访问一个字段当前的记录,我只是写下它的名字,对于

例如:

值=计算

这当然是
CurrentTable.CurrentRecord.Value =计算


要访问另一个字段,我写了

rs.Fields(" Value")


虽然这很有效,但我真的认为这样一个复杂的语法,

,其中使用的是字符串而不是标识符,这是非常不合适的。我想b / b
想想

rs.Value

好​​多了


应该怎么做?它是吗?

-

Feico

With a little help from my friends (that''s you) I succeeded to write a
little program.

To access a field in the current record, I simply write its name, for
example:
Value = calculation
Which is, of course, shorthand for
CurrentTable.CurrentRecord.Value = calculation

To access another field, I write
rs.Fields("Value")

Although this works, I really think that such a complicated syntax,
where a string is used instead of an identifier, is pretty improper. I
think that something like
rs.Value
is a lot better

What should it be?
--
Feico

推荐答案

Feico写道:
在朋友们的帮助下(那就是你)我成功地编写了一个小程序。

要访问当前记录中的字段,我只需写它的名字,用于
例如:
值=计算
当然,这是当前速记的简写。当前时间.CurrentRecord.Value =计算

要访问另一个领域,我写了
rs.Fields(Value)

虽然这个有用,我真的觉得这么复杂的语法,用一个字符串代替一个标识符,非常不合适。我认为
rs.Value
之类的东西好多了

它应该是什么?
With a little help from my friends (that''s you) I succeeded to write a
little program.

To access a field in the current record, I simply write its name, for
example:
Value = calculation
Which is, of course, shorthand for
CurrentTable.CurrentRecord.Value = calculation

To access another field, I write
rs.Fields("Value")

Although this works, I really think that such a complicated syntax,
where a string is used instead of an identifier, is pretty improper. I
think that something like
rs.Value
is a lot better

What should it be?




如果您有一个打开的RecordSet对象,那么您可以参考一个字段...


RS!FieldName


-

我没有查看此邮件附带的电子邮件帐户

。发送给...

在Hunter dot com的RBrandt



If you have an open RecordSet object then you can refer to a field with...

RS!FieldName

--
I don''t check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com


rs.Collect(Index)

即:

rs.Collect(" NameofField")



rs.Collect(3)其中3是该字段的序数位置

仓位从零开始。

rs.Collect(Index)
that is:
rs.Collect("NameofField")
or
rs.Collect(3) where 3 is the ordinal position of the field with the
positions beginning at zero.


2005年10月18日星期二12:39:58 GMT,Rick Brandt"

< ri ********* @ hotmail.com>在comp.databases.ms-access中写道:
On Tue, 18 Oct 2005 12:39:58 GMT, "Rick Brandt"
<ri*********@hotmail.com> wrote in comp.databases.ms-access:
如果你有一个打开的RecordSet对象,那么你可以参考一个字段...

RS! FieldName
If you have an open RecordSet object then you can refer to a field with...

RS!FieldName




我发现这比RS.Fields(FieldName)更整洁了

不幸的是它没有用。

嗯,你说RecordSet必须打开。

我执行了这个:


set db = currentdb

set rs = db.openrecordset(" Table")

这不就是说RecordSet是开放的吗?

-

Feico



I find this much neater than RS.Fields("FieldName")
Unfortunately it didn''t work.
Well, you say that a RecordSet must be open.
I executed this:

set db = currentdb
set rs = db.openrecordset("Table")

Doesn''t that mean that a RecordSet is open?
--
Feico


这篇关于不满意的语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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