k{}

Read(233) Label: serialbyte, byte,

Description:

Get certain bytes from a serial byte to form a new serial byte value.

Syntax:

k{a,…,b:c,…}

Note:

The function gets certain bytes a,…,b:c,… from a serial byte k to form a new serial byte value. {} can only use constants.

Parameters:

k

a

A serial byte value

The ath byte of a serial byte

b:c

The bytes from the bth position to the cth position in a serial byte

Return value:

A serial byte

Example:

=k(4,5,6,8){2}

5; get the second byte from serial byte value k(4,5,6,8) to generate a singe-byte serial byte value

 

=k(4,5,6,8){1:3}

263430; get the bytes from 1 to 3 from serial byte value k(4,5,6,8) to generate a new serial byte value

 

=k(4,5,6,8){1,2,3}

263430; get the first 3 bytes from serial byte value k(4,5,6,8) to generate a new serial byte value

 

=k(4,5,6,8){1,2:3}

263430; get the first byte and the next two bytes from serial byte value k(4,5,6,8) to generate a new serial byte value

 

=k(1,2,3,4,5,6,7){1,2:3,5,6}

4328719622 get the first, the 2nd and 3rd, and the 5th and the 6th bytes from serial byte value k(1,2,3,4,5,6,7) to generate a new serial byte value

 

 

 

 

 

 

A

 

 

1

=create(k1,v1).record([k(1000:3),110000,k(223332:3),2045803,k(31121:3),90730,k(453384:3),78940,k(231410:3),100])

Create a table sequence

 

2

=file("D:/ckv.ctx")

The composite table file

 

3

=A2.create(#k1:3,v1;k1:3)

Create the composite table’s base table where key k1 is the serial byte data whose length is 3

 

4

=A3.append(A1.cursor())

Append cursor records to the base table

 

5

=A3.cursor(k1).fetch()

Return data of column k1 in the base table

 

6

=A3.cursor(k1{1}).fetch()

Get the serial bytes of the fist bytes of k1’s values

 

7

=A3.cursor(k1{2}).fetch()

Get the serial bytes of the second bytes of k1’s values

 

8

=A3.cursor(k1{2:3}).fetch()

Get the serial bytes of the second and third bytes of k1’s values