channel()

Read(3016) Label: channel,

Here’s how to use channel() function.

channel()

Description:

Create a channel.

Syntax:

channel()

Create a channel

Note:

The function creates a channel.

Return value:

Channel

Example:

 

A

 

1

=demo.cursor("select * from SCORES where CLASS = 'Class one'")

 

2

=channel()

Create a channel.

3

>A2.select(STUDENTID==1)

 

4

>A2.fetch()

 

5

=A1.push(A2)

Push data in A1’s cursor to A2’s channel.

6

=A1.fetch()

 

7

=A2.result()

channel(cs)

Description:

Create a channel and push data in a specified cursor into it.

Syntax:

channel(cs)

Note:

The function creates a channel, pushes data in cursor cs into it, and returns a channel. This is equivalent to cs.push(channel()).

Parameter:

cs

A cursor

Return value:

Channel

Example:

 

A

 

1

=demo.cursor("select * from SCORES where CLASS = 'Class one'")

 

2

=channel(A1)

Create a channel  and be ready to push data in A1’s cursor into the new channel, which is equivalent to =A1.push(channel()), and return a channel.

3

>A2.select(STUDENTID==1)

Attach a computation to A2’s channel.

4

>A2.fetch()

Keep data in A2’s channel.

5

=A1.fetch()

Push data into A2’s channel when data is fetched from the cursor.

6

=A2.result()

Get data from A2’s channel.

channel(ch)

Description:

Create a channel and push data in another channel into it.

Syntax:

channel(ch)

Note:

The function creates a channel, pushes data in channel ch into it, and returns a channel. This is equivalent to ch.push(channel()).

Parameter:

ch

A channel

Return value:

Channel

Example:

 

A

 

1

=demo.cursor("select * from SCORES where CLASS = 'Class one'")

 

2

=channel()

Create a channel.

3

=channel(A2)

Create a channel  and be ready to push data in A2’s channel into the new channel, which is equivalent to =A2.push(channel()).

4

>A2.select(STUDENTID==1)

Attach a computation to A2’s channel to select records where STUDENTID is 1.

5

>A3.select(STUDENTID==2)

Attach a computation to A3’s channel to select records where STUDENTID is 2.

6

=A2.fetch()

Keep the current data in A2’s channel .

7

=A3.fetch()

Keep the current data in A3’s channel.

8

=A1.push(A2)

Ready to push A1’s cursor into Channel A2.

9

=A1.fetch()

Perform the push action defined in A8 when data is fetched from the cursor.

10

=A2.result()

Get data from channel A2.

11

=A3.result()

Get data from channel A3.