Ask a Question

Call a Global Variable from another Unit in Vb Script

kaiiii
Regular Contributor

Call a Global Variable from another Unit in Vb Script

How to call a Global Variable declared  in another Unit in VB script.

I used these link for help:

 

1)   https://support.smartbear.com/testcomplete/docs/scripting/calling-routines/declared-in-another-unit/...

 

but i could'nt understand ...please help

1 REPLY 1
baxatob
Community Hero

Say, you have Unit1 and Unit2

 

Let declare a variable A in Unit1:

 

[Unit1]

A = 1

 

Now to call A from Unit2:

 

[Unit2]

'USEUNIT Unit1

Function Test()
  Log.Message(Unit1.A)
End Function
cancel
Showing results for 
Search instead for 
Did you mean: