What is the syntax to cast to an integer?

<variable holding integer> = Int(<value that needs to be cast>)
'examples
MsgBox(Int("001")) 'produces 1
MsgBox(Int(12.1)) 'produces 12

 

 

What are the data types?

There are two categories of data types: numeric and non-numeric.

Numeric types

  • Byte
    • whole numbers
    • 0 to 255
  • Integer
    • whole numbers
    • -32768 to 32767
  • Long
    • whole numbers
    • +/-2,147,483,648
  • Single
    • decimals
    • +/-3.402823E+38
  • Double
    • decimals
    • +/-4.94065645841247E-324
  • Currency
    • decimals
    • +/-922,337,203,685,477.5808
  • Decimal
    • decimals
    • +/- 79,228,162,514,264,337,593,543,950,335

Non-numeric types

  • Stringfixedlength
    • 1-65 000 characters
  • Stringvariablelength
    • 0-2billion characters
  • Date
    • 01/01/100 to 12/31/9999
  • Boolean
    • true or false
  • Object
  • Variantnumeric
    • any value as large as Double
  • Varianttext
    • same as variable-length String

 

What is the syntax to declare variables?

'to declare procedure variables
Dim <variable name> As <variable type>

‘to declare procedure variables that retains value
Static <variable name> As <variable type>

‘module variable
Private <variable name> As <variable type> 

‘global variable
Public <variable name> As <variable type>