Micro Focus QTP (UFT) Forums
Defining variable as Static in QTP script - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Defining variable as Static in QTP script (/Thread-Defining-variable-as-Static-in-QTP-script)

Pages: 1 2


RE: Defining variable as Static in QTP script - rdemers25 - 12-12-2009

Basically how I handle this is I declare a Public variable in a module (I use 1 module that has all my Global Variables). Then if I want to increment like you said I can do it.

i.e.

Code:
ModuleA
Dim ThisIsMyPublicVar

ModuleB
Function Fun1()
  ThisIsMyPublicVar +=1
  --------------
  --------------
End Function