Newline codes in Notes documents

If you write this value to a Notes document:
“Hello” & Chr( 10 ) & “World”
Notes will automatically convert the Chr( 10 ) to a full 2 bytes newline: Chr( 13 ) & Chr( 10 )

Don’t know if this is good or bad – but it took me some time to figure out why the strings on my document was changed…
Sample code:


Dim session As New NotesSession
Dim doc As NotesDocument
Set doc = session.CurrentDatabase.CreateDocument
Dim s As String
s = “Hello” & Chr( 10 ) & “World” ‘Use Chr( 13 ) & Chr( 10 ) instead
doc.string = “Hello” & Chr( 10 ) & “World”
If doc.string( 0 )
s Then
Print “Not has auto converted Chr( 10 ) to Chr( 13 ) & Chr( 10 )”
End If

En tanke om "Newline codes in Notes documents"

  1. It has to do with how data is stored in a Notes Item.
    Internal a newline is stored as Ascii 0x00, and then when you read the data it is translated into newline for the platform you are running on.
    Unix and Linux: n, 10
    Windows: rn, 13 + 10

Skriv et svar

Din e-mailadresse vil ikke blive publiceret. Krævede felter er markeret med *

*