switch (options.effect) {
case 'h-blinds-fadein':
$('.child').each(function(i) {
$(this).stop().css({
opacity: 0
}).delay(100 * i).animate({
'opacity': 1
}, {
duration: options.speed,
complete: (i !== r * c - 1) ||
function() {
$(this).parent().replaceWith(prev);
options.cp.bind('click', {
effect: options.effect
}, options.ch);
}
});
});
break;
case 'h-blinds-fadein-reverse':
$('.child').each(function(i) {
$(this).stop().css({
opacity: 0
}).delay(100 * (r * c - i)).animate({
'opacity': 1
}, {
duration: options.speed,
complete: (i !== 0) ||
function() {
$(this).parent().replaceWith(prev);
options.cp.bind('click', {
effect: options.effect
}, options.ch);
}
});
});
break;
....more …Run Code Online (Sandbox Code Playgroud) 为什么
if SameText(ListBox1.Items[i],Edit1.Text)=true then
Run Code Online (Sandbox Code Playgroud)
不行?它区分大小写(字符串有不同的情况),但必须不是.字符串是unicode.如果字符串具有相同的情况,它可以工作.
谢谢!
我试图在Android应用程序中使用switch语句,我必须检查一个整数是否等于Enum的某些值.代码如下:
public enum RPCServerResponseCode{
E_INCORRECT_LOGIN(4001),
E_ACCOUNT_DISABLED(4002),
E_ACCOUNT_NOT_ACTIVE(4003);
private int value;
private RPCServerResponseCode(int i) {
this.value=i;
}
public static RPCServerResponseCode getByValue(int i) {
for(RPCServerResponseCode dt : RPCServerResponseCode.values()) {
if(dt.value == i) {
return dt;
}
}
throw new IllegalArgumentException("No datatype with " + i + " exists");
}
}
}
Run Code Online (Sandbox Code Playgroud)
我的switch语句如下所示:
int errorCode;
switch(errorCode){
case RPCServerResponseCode.E_INCORRECT_LOGIN :
{
if (user.isAuthenticated)
{
// logout before login
}
break;
}
case RPCServerResponseCode.E_ACCOUNT_NOT_ACTIVE:
{
if (user.isAuthenticated)
{
//logout
}
break;
}
}
}
Run Code Online (Sandbox Code Playgroud)
但我得到错误说:"类型不匹配:无法从RPCCommucatorDefines.RPCServerResponseCode转换为int".有任何建议如何解决这个问题?提前致谢!!!
我正在使用动作管理器处理具有大量动作(超过50个)的delph 7应用程序.并跟踪我有的每一个动作..现在我还有其他如下代码..
procedure TMainForm.OnActionExecute(Sender: TObject);
var
Action : TBasicAction;
begin
Action := Sender as TBasicAction;
if (Action is TAction) and not TAction(Action).Enabled then exit;
if Action = SQLQueryAction then
begin
//do somthing
end
else if (Action = NewSurveyAction) then
begin
//do somthing
end
else if ...
..
..
//lots of actions with if else latr..
end;// of OnActionExecute....
Run Code Online (Sandbox Code Playgroud)
任何人都可以告诉我
如何使用'案例'之类的
case actions of
SQLQueryAction : //do somthing;
newsurveyaction : //do somthing;
//lots …Run Code Online (Sandbox Code Playgroud)可能重复:
Oracle DB:如何编写忽略大小写的查询?
我有一个SQL查询它,并且where条件包含英语和阿拉伯字符,因此我不能使用toupper或tolower,因为阿拉伯字符将显示为问号。
DBMS是Oracle
以下是sybase代码.有人可以看到以下是否正确.我想我错过了某处的语法
declare @test varchar(32)
select @test="/data/dump/team/"
update link
set link.value=
case when @test=substring(link.value,1,17)
then @test
when @test != substring(link.value,1,17)
value
end
where link.value != ""
and link_id=0 and row_id = 462135
Run Code Online (Sandbox Code Playgroud)
因为它给我以下错误:"第10行关键字结束附近的语法不正确".
可以请有人帮我解决语法问题.
在下面的示例中,每次运行代码块时,列"SecondColumn"和"ThirdColumn"将始终更新.'FirstColumn'将更新为存储在变量中的值@NumberOfRows(只要它> 0).
我遇到的问题是当@NumberOfRows0或更小时,'FirstColumn'将被设置为NULL.
是否可以调整此值,以便if @NumberOfRows为0或更小,那么'FirstColumn'根本不更新而不是将列设置为NULL?
DECLARE
@NumberOfRows INT = 0
,@NewValue DATETIME = GETDATE()
,@Other INT = 99
BEGIN
UPDATE x
SET x.FirstColumn = (CASE WHEN @NumberOfRows > 0 THEN @NewValue END)
,x.SecondColumn = SYSDATETIMEOFFSET()
,x.ThirdColumn = @Other
FROM TestTable x
WHERE x.ID = 100
END
Run Code Online (Sandbox Code Playgroud) 我正在尝试在case语句中匹配5到7个数字的字符串.我没有尝试过任何成功的工作.这是我尝试过的事情之一.
^[0-9]*$ )
echo "Got it!"
;;
Run Code Online (Sandbox Code Playgroud)
我该如何成功完成?
我是Scala的新手并尝试使用以下继承:
abstract class Command(arg: Any)
case object Help extends Command // <---- Ok
Run Code Online (Sandbox Code Playgroud)
但如果我用这个代替它:
abstract class Command(arg: Option[Any])
case object Help extends Command // <---- Fail
Run Code Online (Sandbox Code Playgroud)
为什么?为什么它在第一个例子中工作?
我想在我的代码中使用switch,但我不知道如何使用&&以防万一!这是我的代码
string a;
a = System.Convert.ToString(textBox1.Text);
if (a.Contains('h') && a.Contains('s'))
{
this.BackColor=Color.Red;
}
else if (a.Contains('r') && a.Contains('z'))
{
this.BackColor=Color.Black;
}
else if (a.Contains('a') && a.Contains('b'))
{
this.BackColor = Color.Pink;
}
Run Code Online (Sandbox Code Playgroud) case ×10
delphi ×2
if-statement ×2
bash ×1
c# ×1
delphi-7 ×1
enums ×1
ignore ×1
inheritance ×1
java ×1
javascript ×1
jquery ×1
numeric ×1
oracle ×1
refactoring ×1
scala ×1
select ×1
sql ×1
sql-server ×1
sql-update ×1
string ×1
text ×1