Lasso Soft Inc. > Home

[Bytes]

[Bytes] creates a byte stream that can be used to work with binary data or to convert strings from one character set to another. The [Bytes] tag can be used to instantiate a new bytes object, or it can be used to cast string data types as bytes types. Only string data types may be cast as bytes data types.

In the first form the tag accepts two optional parameters. The first parameter is a string to be imported into the byte stream. The second parameter defines what character set the string is transformed into before it is imported (e.g. iso-8859-1). If no character set is specified then the string is imported as UTF-8.

In the second form the tag accepts two optional parameters. The first specifies the size of the memory buffer in bytes that should be allocated to hold the byte stream. The second specifies the number of bytes that should be added if the initial memory buffer is too small to hold the entire byte stream.

  • Syntax
  • Parameters
[Var: 'Bytes_Import' = (Bytes: 'String Value')]

[Var: 'Bytes_ISO_Import' = (Bytes: 'String Value', 'iso-8859-1')]

[Var: 'Bytes_Preallocate' = (Bytes: 1024)]

[Var: 'Bytes_Growth' = (Bytes: 1024, 256)]
Optional Parameters
Buffer Size The initial size of the buffer for the byte stream in bytes.
Grow Size The increment in bytes to grow the byte stream buffer.
String Import A string to import into the byte stream.
String Import Charset An optional character set to use to import the string.
Examples

See the Lasso 8 Language Guide for examples of how to use this tag. This tag is documented on page 92.

Tag Link [Bytes] Category Bytes
Type Substitution Data Source Any
Support Preferred Version 7.0
Output Type Bytes Security None
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft