Teledyne-lecroy SAS_SATA Protocol Suite Verification Script Engine Instrukcja Użytkownika Strona 68

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 97
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 67
68
18.4 WriteBin ()
This function writes content to a binary file.
Format : WriteBin( bin_file_handle, variable )
Parameters
bin_file_handle File handle for the binary file (only opened using
_FO_BINARY), to which the contents are to be written.
variable Any variable type (integer, string, list, and raw string)
Return Value
_BF_RW_OK Read/Write binary returns succesfully
_BF_RW_INVALID_HANDLE (1) Invalid File Handle
_BR_RW_INALID_VALUE Invalid Value
Example
# Opens file in binary mode with _CREATE functionality.
bin_file_handle = OpenFile("Sample.bin", _FC_RW_CREATE,
_FO_BINARY );
raw_data = ‘00112233445566778899AABBCCDD';
list_val = ["one", 2, "three", [4, [5, [6]]]];
# Write text string to file.
WriteBin( bin_file_handle, "Some Text1" );
# Write integer to file.
WriteBin( bin_file_handle, 0x1234ABCD);
# Write raw data to file.
WriteBin( bin_file_handle, raw_data);
# Write list to file.
WriteBin( bin_file_handle, list_val);
CloseFile( bin_file_handle ); # Closes file.
Przeglądanie stron 67
1 2 ... 63 64 65 66 67 68 69 70 71 72 73 ... 96 97

Komentarze do niniejszej Instrukcji

Brak uwag