Read - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

DataInterfaceStream

 get a block of the data stored in the DataInterfaceStream module

 Calling Sequence stream:-Read( number )

Parameters

 stream - DataInterfaceStream module number - integer; amount of data to read

Description

 • Read returns the next number elements of data from stream. If stream stores a character type, then the elements are characters and a string is returned. If stream stores binary data, then an element is of type integer[1] and an rtable is returned.
 • If there are less than number elements in the stream, all the remaining elements are returned, as with the Get command.

Examples

 > $\mathrm{driver}≔{\mathrm{Database}}_{\mathrm{LoadDriver}}\left(\right):$
 > $\mathrm{conn}≔\mathrm{driver}:-\mathrm{OpenConnection}\left(\mathrm{url},\mathrm{name},\mathrm{pass}\right):$$\mathrm{res}≔\mathrm{conn}:-\mathrm{ExecuteQuery}\left("SELECT * FROM stream"\right):$$\mathrm{res}:-\mathrm{Next}\left(\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{res}:-\mathrm{GetData}\left(1\right)$
 ${"the quick brown fox jumped over the lazy dog"}$ (2)
 > $\mathrm{res}:-\mathrm{GetData}\left(2\right)$

 [   1..127 1-D Array    ] [ Data Type: integer[1] ] [ Storage: rectangular  ] [    Order: C_order     ]

 > $\mathrm{str}≔\mathrm{res}:-\mathrm{GetData}\left(1,\mathrm{stream}=\mathrm{true}\right):$$\mathrm{str}:-\mathrm{Type}\left(\right)$
 ${\mathrm{VARCHAR}}$ (3)
 > $\mathrm{str}:-\mathrm{Read}\left(5\right)$
 ${"the q"}$ (4)
 > $\mathrm{str}:-\mathrm{Skip}\left(5\right);$$\mathrm{str}:-\mathrm{Read}\left(5\right)$
 ${"brown"}$ (5)
 > $\mathrm{str}≔\mathrm{res}:-\mathrm{GetData}\left(2,\mathrm{stream}=\mathrm{true}\right):$$\mathrm{str}:-\mathrm{Type}\left(\right)$
 ${\mathrm{BINARY}}$ (6)
 > $\mathrm{str}:-\mathrm{Read}\left(5\right)$
 $\left[{1}{,}{2}{,}{3}{,}{4}{,}{5}\right]$ (7)
 > $\mathrm{str}:-\mathrm{Skip}\left(5\right);$$\mathrm{str}:-\mathrm{Read}\left(5\right)$
 $\left[{11}{,}{12}{,}{13}{,}{14}{,}{15}\right]$ (8)