n = Pm.FileBinaryWrite(sFile, nOffset, nAttr, Values)
|sFile||(String) file name (with the path). If a full path is not entered, it is completed relatively according to the application file folder. |
It is recommended to use the PROMOTIC path syntax - see PROMOTIC path to files and folders.
|nOffset||(Long) Byte offset that sets the beginning of writing into the binary file (e.g. 10 means writing into 10th byte of the file). If the value is -1, offset is set to the end of the file. The parameter has the importance only for nAttr=1, otherwise nOffset=0 must be set.|
|nAttr||(Long) Bit attribute. It can be 0 or a sum of the following applicable values.|
1 - If the file already exists, its content will be overwritten from the offset (see the nOffset parameter). If the value 1 is not set, the entire content of the file will be cleared before writing.
2 - Value of the String type (text string) is stored without the string end character. If the value 2 is not set, the string is stored into the file and one more byte with the value 0 is added (the string end character).
|Values||(Variant) Variable of the Array type whose items are stored.|
Individual array items are stored according to their data type in this matter:
|Data type:||Number of stored bytes into the file:|
|String||Number of characters + 1 (1 for the character 0 only if nAttr=2 is not set)|
Dim Val(3), length
Val(0) = CLng(1)
Val(1) = "test"
Val(3) = true
length = Pm.FileBinaryWrite("#data:File.bin", 0, 0, Val)
If length = 4+5+8+1 Then