delphi中如何动态向枚举类型中添加值
答案:3 悬赏:70 手机版
解决时间 2021-04-07 21:09
- 提问者网友:王者佥
- 2021-04-07 04:55
我的意思是,能不能先定一个空的枚举类型然后,程序运行后动态往里面添加值,最后再用一个已经知道的值去判断它是不是在枚举类型当中。要有代码。
最佳答案
- 五星知识达人网友:由着我着迷
- 2021-04-07 05:41
Set operators
Operator Operation Operand types Result type Example
+ union set set Set1 + Set2
- difference set set S - T
* intersection set set S * T
<= subset set Boolean Q <= MySet
>= superset set Boolean S1 >= S2
= equality set Boolean S2 = MySet
<> inequality set Boolean MySet <> S1
in membership ordinal, set Boolean A in Set1
用in操作符啊。
Operator Operation Operand types Result type Example
+ union set set Set1 + Set2
- difference set set S - T
* intersection set set S * T
<= subset set Boolean Q <= MySet
>= superset set Boolean S1 >= S2
= equality set Boolean S2 = MySet
<> inequality set Boolean MySet <> S1
in membership ordinal, set Boolean A in Set1
用in操作符啊。
全部回答
- 1楼网友:思契十里
- 2021-04-07 07:01
in
- 2楼网友:山河有幸埋战骨
- 2021-04-07 06:26
test.dpr.18: e:=meval1;
0040a179 33db xor ebx,ebx
test.dpr.20: writeln(ord(e)); //显示0
0040a17b 0fb6d3 movzx edx,bl
0040a17e a14cbc4000 mov eax,[$0040bc4c]
0040a183 e88098ffff call @write0long
0040a188 e8a798ffff call @writeln
0040a18d e8828fffff call @_iotest
test.dpr.22: e:=meval3;
0040a192 33db xor ebx,ebx
test.dpr.24: writeln(ord(e)); //显示0
0040a194 0fb6d3 movzx edx,bl
0040a197 a14cbc4000 mov eax,[$0040bc4c]
0040a19c e86798ffff call @write0long
0040a1a1 e88e98ffff call @writeln
0040a1a6 e8698fffff call @_iotest
test.dpr.26: writeln(ord(low(e))); //显示0
0040a1ab a14cbc4000 mov eax,[$0040bc4c]
0040a1b0 33d2 xor edx,edx
0040a1b2 e85198ffff call @write0long
0040a1b7 e87898ffff call @writeln
0040a1bc e8538fffff call @_iotest
test.dpr.28: writeln(ord(high(e))); //显示1
0040a1c1 a14cbc4000 mov eax,[$0040bc4c]
0040a1c6 ba01000000 mov edx,$00000001
0040a1cb e83898ffff call @write0long
0040a1d0 e85f98ffff call @writeln
这是对应的汇编代码, low(e), high(e)都是直接赋值0, 1的
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯