Global Statement

 

Global Const constant

 

The Global Statement must be outside the procedure section of the script.  Global variables are available to all functions and subroutines in your program

 

Related Topics: Dim, Const and Type Statements

 

Example:

 

Global Const Height = 14.4357     '

Const PI = 3.14159      'Global to all procedures in a module

Sub Main ()

   Begin Dialog DialogName1 60, 60, 160,70, "ASC - Hello"

   TEXT 10, 10, 100, 20, "Please fill in the radius of circle x"

   TEXT 10, 40, 28, 12, "Radius"

   TEXTBOX 42, 40, 28, 12, .Radius

   OKBUTTON 42, 54,40, 12

End Dialog

Dim Dlg1 As DialogName1

Dialog Dlg1

CylArea = Height * (Dlg1.Radius * Dlg1.Radius) * PI

MsgBox "The volume of Cylinder x is " & CylArea

End Sub