Integer

DIM Var AS Integer

Este tipo de dato nativo representa un valor numérico entero de 4 bytes con signo.

El valor de un Integer está comprendido entre -2.147.483.648 y +2.147.483.647. (-2^31 y 2^31-1). Para enteros mas grandes se debe utilizar Long.

Los valores Integer se pueden expresar en decimal, hexadecimal y binario.

Los valores Hexadecimal comienzan con & o con &H o &h

Valores binarios comienzan con &X o &x

hexadecimal constants with a value which would fit in 4 digits are sign expanded from bit 15 to bits 16 to 31, if no trailing & is added to the constant. Consider this when defining colors as constants : &H0000FF00 will be yellow (same as &H00FFFF00, because it will be sign expanded to &HFFFFFF00) where &H0000FF00& will be green.

Constante Decimal Hexadecimal
&HC000 the sign will be extended -16384 FFFFC000
&HC000& no extension of sign 49152 0000C000
&H1C000 no sign extension 114688 0001C000

Véase también