VS:WriteBin: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
No edit summary
(expand example)
 
(4 intermediate revisions by the same user not shown)
Line 6: Line 6:
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<desc>
<desc>
Procedure WriteBin outputs the specified data to a binray file. The variable length parameter list specifies the data to be written to the file. <BR>
Procedure WriteBin outputs the specified data to a binary file. The variable length parameter list specifies the data to be written to the file.
<BR>
 
Supported data types include INTEGER (2-bytes), REAL (8-bytes), LONGINT (4-bytes), CHAR (1-byte) or STRING/DYNARRAY OF CHAR (see remarks). <BR>
Supported data types include INTEGER (2-bytes), REAL (8-bytes), LONGINT (4-bytes), CHAR (1-byte) or STRING/DYNARRAY OF CHAR (see remarks).
<BR>
 
The bytes will be written as little-endian. <BR>
The bytes will be written as little-endian.
<BR>
 
Strings will require two additional INTEGER parameters: symbol count and encoding: 0 – mac; 1 – win; 2 – system; 3 – UTF8; 4 – UTF16.</desc>
Strings will require two additional INTEGER parameters: symbol count and encoding:
: 0 – mac
: 1 – win
: 2 – system
: 3 – UTF8
: 4 – UTF16
</desc>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Line 42: Line 48:
<sample>
<sample>
<code lang='vs'>
<code lang='vs'>
WriteBin(Value1);</code>
WriteBin('text', 0); { string, mac }
WriteBin(1234); { number }
</code>
</sample>
</sample>


Line 50: Line 58:
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<version>
<version>
Availability: from Vectorworks 2019
Availability: from Vectorworks 2018


</version>
</version>

Latest revision as of 10:24, 25 December 2017

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

Procedure WriteBin outputs the specified data to a binary file. The variable length parameter list specifies the data to be written to the file.

Supported data types include INTEGER (2-bytes), REAL (8-bytes), LONGINT (4-bytes), CHAR (1-byte) or STRING/DYNARRAY OF CHAR (see remarks).

The bytes will be written as little-endian.

Strings will require two additional INTEGER parameters: symbol count and encoding:

0 – mac
1 – win
2 – system
3 – UTF8
4 – UTF16
PROCEDURE WriteBin(
z :ANY);
def vs.WriteBin(z):
    return None

Parameters

z ANY

Example

WriteBin('text', 0); { string, mac }
WriteBin(1234); { number }

Version

Availability: from Vectorworks 2018

See Also

VS:ReadBin | VS:Open

[[VS:ReadBin]] | [[VS:Open]]