if-statement

Compact if check involving multiple strings in Fortran [duplicate]

给你一囗甜甜゛ 提交于 2020-08-26 09:25:26
问题 This question already has an answer here : How to check if Fortran array contains value? (1 answer) Closed 12 days ago . Is there a way to check if a string is equal to any of the list together instead of individually explicitly check with a == ? For example, if(color=='violet' .or. color=='indigo' .or. color=='blue' .or.& color=='green' .or. color=='yellow' .or. color=='orange' .or. color=='red') then print *, "It is a rainbow color" end if Is there a way compact way to do this? Something

conditional insert statement in sqlite triggers

老子叫甜甜 提交于 2020-08-21 05:18:07
问题 Are conditional if/case/when statements supported in sqlite triggers? Let`s say I have the following setup: CREATE TABLE someTable (id INTEGER PRIMARY KEY, someValue INTEGER); CREATE TRIGGER update_another_table AFTER INSERT ON someTable BEGIN IF(new.someValue==0) DELETE FROM another_table WHERE (...some condition); ELSE IF NOT EXISTS(SELECT anotherValue FROM another_table WHERE anotherValue =new.someValue) INSERT INTO another_table VALUES(new.someValue, ...); ELSE UPDATE another_table SET