部分代码
macro_command main()
short n[4],i=0,i1=0,i2=1,b
bool OFF=0
GetData(n[0], "Local HMI", LW, 0, 4)
for i=0 to 3
i1=0
for i1=0 to 2
i2=i1+1
if n[i1] > n[i2] then
b=n[i1]
n[i1]=n[i2]
n[i2]=b
end if
next
next
SetData(n[0], "Local HMI", LW, 100, 4)
SetData(OFF, "Local HMI", LB, 1, 1)
end macro_command
源文件包含升序,降序,随机数 试例
源文件下载 |