/
writeBool
writeBool
Description
Use to write one or more Boolean values to a file. This command accepts any number of Boolean arguments, including arrays.
The following list shows the different cast types. Note that data can be lost when casting. 'Signed' means the value can be negative. 'Unsigned' means value will always be positive.
Cast | Description |
---|---|
"c" | Writes Boolean as a signed character, or a signed 8 bit (1 byte) value |
"uc" | Writes Boolean as an unsigned character, or a unsigned 8 bit (1 byte) value |
"s" | Writes Boolean as a signed short integer, or a signed 16 bit (2 bytes) value |
"us" | Writes Boolean as an unsigned short integer, or an unsigned 16 bit (2 bytes) value |
"i" | Writes Boolean as a signed integer, or a signed 32 bit (4 bytes) value |
"ui" | Writes Boolean as an unsigned integer, or an unsigned 32 bit (4 bytes) value |
"f" | Writes Boolean as a floating point value, a 32 bit (4 byte) value |
Functional area
Disk I/O
Command syntax
Syntax
writeBool fileID boolVal1 [boolVal2...] [-cast string] |
Arguments
Name | Type | Required | Comments |
---|---|---|---|
boolean2 | Optional Boolean or Boolean array: Command can accept any number of Booleans/arrays to write to the file | ||
boolean1 | Boolean or Boolean array: 1 or more values to be written to the file | ||
fileID | int | ID of file previously opened with fileOpen. |
Flags
Name | Flag arguments | Argument type | Exclusive to | Comments |
---|---|---|---|---|
cast | 1 | string | — | Data type to cast to. Possible types are listed above. Note that data can be lost when casting. |
Return value
void
Examples
//Write example boolean $val = true; int $fileID; int $fileID = `fileOpen "C:/FileTesting.txt" "w"`; // Write the boolean value writeBool $fileID $val; fileClose $fileID;
Additional information
Related commands
, multiple selections available,