LibreOffice 7.3 Help
Geeft het teken dat overeen komt met de gespecificeerde tekencode terug.
Chr[$](expression As Integer) As String
String
Expression: a numeric expression that represents a valid 8-bit ASCII value (0-255) or a 16-bit Unicode value. (To support expressions with a nominally negative argument like Chr(&H8000) in a backwards-compatible way, values in the range −32768 to −1 are internally mapped to the range 32768 to 65535.)
When VBA compatibility mode is enabled (OPTION VBASUPPORT 1), Expression is a numeric expression that represents a valid 8-bit ASCII value (0-255) only.
De Chr$-functie wordt vaak gebruikt om speciale stuurcodes naar een printer of andere uitvoerbron te zenden. U kunt de functie ook gebruiken om aanhalingstekens in een tekenreeks in te voegen.
An overflow error will occur when VBA compatibility mode is enabled and the expression value is greater than 255.
Sub ExampleChr
' Dit voorbeeld voegt een apostrof (ASCII waarde 34) in een tekenreeks in.
MsgBox "A "+ Chr$(34)+"short" + Chr(34)+" trip."
' De afdruk verschijnt in het dialoogvenster als: Een "korte" trip.
End Sub