Teledyne-lecroy UWBTracer Verification Script Engine Manual Instrukcja Użytkownika Strona 74

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 95
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 73
LeCroy Corporation Verification Script Engine Manual, version 2.2
18.4 Write()
This function writes data to the file.
Format: Write(file_handle, value, num_of_bytes)
Parameters:
file_handle "handle" to the file previously opened by OpenFile()
value Data to write
num_of_bytes Optional parameter specifying how many bytes to take from the
value parameter (if omitted, length is calculated automatically
based on the value type)
Remarks:
This function is primarily for binary files. It can be used for text files only if the value parameter is a string
of text. In that case, it is equivalent to the WriteString() function and the num_of_bytes parameter is ignored.
Example:
set BinFile = 0;
BinFile = OpenFile("C:\\data.bin", 0, _FO_BINARY);
# Write a string to the binary file.
Write(BinFile, "All we need is love!!!");
# Write a substring ("All") to the binary file.
Write(BinFile, "All we need is love!!!", 3);
val = 0xBEEF;
Write(BinFile, val); # Writes integer = (EF BE 00 00) to the binary file.
Write(BinFile, val, 2); # Writes WORD = (EF BE) to the binary file.
# Write a byte chain to the binary file.
Write(BinFile, 'AABBCCDDEEFF12345678');
# Write a list of values to the binary file.
Write(BinFile, [ 0xAA, "UWB", 12, 0xBEEF ]);
CloseFile(BinFile); # Closes the binary file.
Page 74 of 95
Przeglądanie stron 73
1 2 ... 69 70 71 72 73 74 75 76 77 78 79 ... 94 95

Komentarze do niniejszej Instrukcji

Brak uwag