Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias ui1_inputTest {
- ;; DATA TO PASS INTO THE THE COM AS A UI1 ARRAY: text\0text2
- bset -t &ui1_data -1 text1
- bset &ui1_data -1 0
- bset -t &ui1_data -1 text2
- echo -s bvar size: $bvar(&ui1_data, 0) (should be 10)
- .comopen ui1_test ADODB.Stream
- if (!$com(ui1_test) || $comerr) {
- echo -a failed to create stream instance
- }
- elseif (!$com(ui1_test, open, 1) || $comerr) {
- echo -a Failed to open stream
- }
- elseif (!$com(ui1_test, type, 4, integer, 1) || $comerr) {
- echo -a Failed to set the read/write type to binary
- }
- ;; THIS LINE PASSES THE BVAR IN AS A VT_ARRAY<ui1>
- elseif (!$com(ui1_test, write, 1, array &ui1, &ui1_data) || $comerr) {
- echo -a Failed to write data to stream
- }
- elseif (!$com(ui1_test, position, 4, integer, 0) || $comerr) {
- echo -a Failed to reset position
- }
- elseif (!$com(ui1_test, saveToFile, 1, bstr, $mircdirui1_text.txt, integer, 2) || $comerr) {
- echo -a Failed to save to file
- }
- elseif (!$com(ui1_test, close, 1) || $comerr) {
- echo -a Failed to close stream
- }
- else {
- echo -a All done; wrote to $mircdirui1_text.txt
- run $mircdirui1_text.txt
- }
- if ($com(ui1_test)) {
- .comclose ui1_test
- }
- .remove $mircdircui1_text.txt
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement