布尔值和条件码 [英] Booleans and Conditional Code

查看:82
本文介绍了布尔值和条件码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

@NeoPa。


我讨厌与你争论,因为你是一个比我更好的程序员,但我不喜欢([Alive]的价值的假设) 是真的。我认为在阅读代码时要更清楚地说明它的价值: - Alive = True。


([Alive])对于有经验的程序员来说很好,但是这个网站的很多订阅者都不会像我们的老男孩那样使用Access。


Phil


{此线程与如何在表中取消记录

-NeoPa。}

@NeoPa.

I hate arguing with you, as you are an infinitely better programmer than I am, but I do not like the assumption that the value of ([Alive]) is True. I think it is much clearer when reading the code to state it''s value :- "Alive = True".

([Alive]) is fine for experienced programmers, but not for a lot of subscribers to this site who have not been using Access for as long as we old boys have.

Phil

{This thread was split off from How to Deactive a Record in a Table.
-NeoPa.}

推荐答案

Phil,


我们应该永远请记住,这个论坛旨在将年轻的Padwans培养成经验丰富的绝地武士。我们不会教孩子不正确地拿铅笔,以便在将来的某个时间正确地教他们。


在这种情况下,NeoPa的建议告诉OP查看布尔值作为完整的实体。这个概念还允许我们在项目的其他地方使用这些实体。例如,在我年轻(愚蠢)的日子里,你会看到这样的代码:

Phil,

We should always keep in mind that this forum aims to develop young Padwans into experienced Jedi Knights. We don’t teach children to hold a pencil incorrectly with the aim of teaching them correctly at some time in the future.

In this case NeoPa’s advice teaches the OP to look at Boolean values as complete entities. This concept also allows us to use those entities elsewhere in our projects. For example, in my younger (stupider) days, you would see code like this:

展开 | 选择 | Wrap | 行号


Not菲尔需要我的任何帮助,但我相信他指示OP使用是。或真在底层查询网格中,而不是在与Form事件关联的任何VBA代码中。
Not that Phil needs any of my assistance, but I believe he was instructing the OP to use "Yes" or "True" in the underlying query grid and not in any VBA code associated with Form events.


@ Nauticalgent


Spot on。 OP询问Queries。


@Twinnyfo


在某种程度上我同意,但我记得学会走在你面前学会运行


也许我们应该展示代码的爆炸版本然后拿出One Liner。那个专家会使用。


Phil
@ Nauticalgent

Spot on. The OP was asking about Queries.

@ Twinnyfo

To a certain extent I agree, but I recall "Learn to walk before you learn to run"

Perhaps we should show the "exploded version of the code and then come up with the "One Liner" that the "Experts" would use.

Phil


这篇关于布尔值和条件码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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