begin
case edit1.Text of
'k':showmessage('kkkkkkk');
's':showmessage('sssssss');
'l':showmessage('lllllll');
end;
end;
我现在写错了,请问各位大哥,这样CASE OF我该怎么写才对。
case edit1.Text of
'k':showmessage('kkkkkkk');
's':showmessage('sssssss');
'l':showmessage('lllllll');
end;
end;
我现在写错了,请问各位大哥,这样CASE OF我该怎么写才对。
case edit1.Text[1] of
'k':showmessage('kkkkkkk');
's':showmessage('sssssss');
'l':showmessage('lllllll');
end;呵呵
const
strArray : array [0..10] of string =(['str0', 'str1', 'str2', ...);for i := 0 to 10 do
if strArray[i] = str then
case i of
0: do str1 thing
1: do str1 thing
2:
...
end;
可用此函数取字符index.
然后:
case j of
0: showmessage('A');
1: showmessage('B');
.....
end;
就是这个意思
case ** of
**是个排序的意思了
诸如用1,2,3
case edit1.Text[1] of
'k':showmessage('kkkkkkk');
's':showmessage('sssssss');
'l':showmessage('lllllll');
end;呵呵
// 好像VC 也不支持字符串吧
char c;
switch c
{
case 'c':
case 'C':....
}
是。
如果不用其他类似于上面的case string[0]之类的手段