LibreOffice 7.2 Hjälp
Returnerar det tecken som motsvarar teckenkoden.
Chr(Uttryck As Integer)
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.
Du kan t.ex. använda funktionen Chr$ för att skicka styrkoder till en skrivare eller annan kringutrustning. Du kan också använda funktionen för att lägga till citattecken i en sträng.
6 Spill, when VBA compatibility mode is enabled and expression is greater than 255.
Sub ExampleChr
' I det här exemplet infogas citattecken (ASCII-värde 34) i en sträng
MsgBox "En "+ Chr$(34)+"kort" + Chr$(34)+" resa."
' Texten i dialogrutan blir: En "kort" resa
End Sub