Funzione esadecimale VBScript


❮ Riferimento completo di VBScript

La funzione esadecimale restituisce una stringa che rappresenta il valore esadecimale di un numero specificato.

Nota: se il numero non è un numero intero, viene arrotondato al numero intero più vicino prima di essere valutato.

Sintassi

Hex(number)

Parameter Description
number Required. Any valid expression

If number is:

  • Null - then the Hex function returns Null.
  • Empty - then the Hex function returns zero (0).
  • Any other number - then the Hex function returns up to eight hexadecimal characters.

Esempio

Esempio

<%

response.write(Hex(3) & "<br />")
response.write(Hex(5) & "<br />")
response.write(Hex(9) & "<br />")
response.write(Hex(10) & "<br />")
response.write(Hex(11) & "<br />")
response.write(Hex(12) & "<br />")
response.write(Hex(400) & "<br />")
response.write(Hex(459) & "<br />")
response.write(Hex(460) & "<br />")

%>

L'output del codice sopra sarà:

3
5
9
A
B
C
190
1CB
1CC

❮ Riferimento completo di VBScript