Variables

 

VBA Code Protection > Supported VBA syntax by compiler > Variables

 

There is no need to declare variable in script but, if you want to, you declare variable just using DIM directive and its name.

 

SUB Msg(Param1)

   DIM S

   S = "Hello world!"

   ShowMessage(S)

END SUB

 

Sub Make(Param1)

DIM A

A = 0

A = A+1

ShowMessage(A)

END SUB

 

You can also declare global variables as private or public using the following syntax:

PRIVATE A

PUBLIC B

B = 0

A = B + 1

ShowMessage(A)

 

Variable declared with DIM statement are public by default. Private variables are not accessible from other scripts.

Variables can be default initialized with the following syntax

DIM A = "Hello world"

DIM B As Integer = 5

 

Indexes

 


Copyright © 2021 G.D.G. Software