我有這個循環,每次條件爲真時都會彈出一個消息框。 For i = 0 To DataGridView1.Rows.Count - 1
Dim c As Boolean
c = DataGridView1.Rows(i).Cells(0).Value
If c = True Then
cmd3.Connection = con
con.
可能重複: Get person's age in Ruby 我是很新的Ruby on Rails的,和我剛剛創建了一個小程序來店裏的人,用自己的名字,出生日期(DOB ),性別等。但是,當我使用@persons = Persons.find(:all)查詢數據庫中的人員,並嘗試列出他們時,我很想展示他們的年齡,即今天 - persons.dob,而不是他們的出生日期正確。
我有這個代碼。 true_var和other_true_var是boolean值。四個條件分支是不同的。 if true_var && other_true_var:
# do something 0
else if true_var && not other_true_var:
# do something 1
else if not true_var && other_