描述:
获取移位后的源序列。
语法:
A.shift(i,s)
备注:
遍历序列A中的成员,当该成员在序列A中的序号大于等于i并且小于等于[A.len()-s]时,返回该成员后的第s个成员,否则返回该成员。A.len()为序列A的长度。当i与s之和大于A.len() 时,序列不移位。
参数:
i
|
起始位置,正整数,缺省为1。
|
s
|
移位量,正整数,缺省为1。
|
返回值:
序列
示例:
|
A
|
|
1
|
[1,2,3,4,5,6,7,8,9,10]
|
|
2
|
=A1.shift(4,3)
|
![](函数参考.files/image2714.jpg)
|
3
|
=to(10).new(~:id,~*~:value)
|
|
4
|
=A3.shift(3,2)
|
移位前:
![](函数参考.files/image2716.jpg)
移位后:
![](函数参考.files/image2718.jpg)
|