Guida di LibreOfficeDev 7.4
Restituisce il carattere corrispondente al codice specificato.
Chr[$](charcode As Integer) As String
String
charcode: 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), charcode is a numeric expression that represents a valid 8-bit ASCII value (0-255) only.
Potete usare la funzione Chr$ per inviare speciali sequenze di controllo a una stampante o a un altro dispositivo di output. Potete anche usarla per inserire le virgolette in una stringa.
Si verificherà un errore di overflow nel caso in cui il modo compatibilità VBA sia abilitato e il valore dell'espressione sia maggiore di 255.
Sub ExampleChr
' Questo esempio inserisce le virgolette (valore ASCII 34) in una stringa.
MsgBox "A " + Chr$(34) + "short" + Chr(34) + " trip."
' Il risultato appare nella finestra di dialogo nella forma: Una "breve" gita.
MsgBox Chr(charcode := 64) ' "@" sign
End Sub