문제

How do read from a NotesStream character by character. i.e one character at a time in a loop. NoteasStream.Read(1) reads one character but returns a variant array which I am not able to convert to the specific character.

도움이 되었습니까?

해결책

This way you can read byte by byte from stream

Dim stream As NotesStream
Dim bytes As variant
...
Do
    bytes = stream.Read(1)
    Print bytes(0)
Loop Until stream.IsEOS

Probably more efficient is it to read more then just one byte at a time from stream

Dim stream As NotesStream
Dim bytes As variant
...
Do
    bytes = stream.Read(32767)
    ForAll b In bytes
        Print b
    End ForAll
Loop Until stream.IsEOS

If you want to get characters instead of bytes one by one then you can use this

Dim stream As NotesStream
...
Dim buffer As String
Dim i As Long
Dim char As String
buffer = stream.ReadText()
For i=1 To Len(buffer)
    char = Mid(buffer, i, 1)
    Print char
Next
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top