如何突破一个循环?

时间:2015-09-04 10:05:29

标签: conditional-statements swift2

使用此条件:

while let element = enumerator.nextObject() as? String

如何根据递减的整数添加另一个条件:

var c=10
while let element = enumerator.nextObject() as? String && c>0 {
...
c--
...
}

错误是:

Optional type 'Bool' cannot be used as a boolean; test for '!= nil' instead

1 个答案:

答案 0 :(得分:1)

而不是CREATE TRIGGER trgAfterInsert ON [dbo].[table2] FOR INSERT AS BEGIN SET NOCOUNT ON; insert into table2_Audit (c1,c2,Audit_Action,Audit_Timestamp) SELECT C1 , C2 , 'Inserted Record -- After Insert Trigger.' , GETDATE() FROM inserted ; PRINT 'AFTER INSERT trigger fired.' END GO 使用&&子句:

where