Forum Discussion

glarsen_1's avatar
glarsen_1
Occasional Contributor
13 years ago

Declaring a sys.process() as a variable

Hey,

i am testing a program and to make it easier I want to declare for example:

     Set GMS = Sys.Process("GMS")

and I want to be able to use it from another script, using the 'USEUNIT



The problem I'm running into is when I try to run the script and an instance of GMS has not yet been started on the computer it gets stuck "waiting for GMS"/I get a VBScript error...



Is there any way to declare in such a way that even though it doesn't exist now, I know it will later so just ignore it for now? I want it to be accessible from many different scripts so I don't have to declare it I all of them.



Also to test the way I want I. Need to use sys.process. I cant use aliases...



Thanks for your help!
  • Hi Gage,



    You could try to use Sys.WaitProcess instead of Sys.Process. This will wait X time (it's a parameter) for the process to exist. After that time, the script goes on. You can check it on the help.



    I don't know much about VB capabilities, but in JavaScript I create a class in those cases so I put a higher control level of the process.



    Hope it helped!