SetEnvVar causes an modal Dialog box to popup

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
jwm0vmh
Newbie
Posts: 9
Joined: Sun Jul 06, 2003 3:44 pm

SetEnvVar causes an modal Dialog box to popup

Post by jwm0vmh » Fri Jan 28, 2005 4:47 pm

The following script causes a modal dialog box, with the title Macro..., to pop up when the script executes the setenvvar command. The user must click the OK button in the dialog box before processing continues. How do I keep the dialog box from appearing each time setenvvar is executed? I've included an example of the scripts causing the problem.

//testenvvar.exe
let>test1=Yo! Yo! Yo!
setenvvar>test,%test1%
wait>.3
run program>C:\Program Files\MJT Net Ltd\Macro Scheduler\testenvvar2.exe

//testenvvar2.exe
getenvvar>test,test
messagemodal>%test%

Thanks,
JWM

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Jan 28, 2005 10:03 pm

I get the same result. The window that comes up shows the message "true".

I tried adding CloseWindow>Macro* as next command, but the "true" message comes up before that line of script is executed.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Sat Jan 29, 2005 1:15 pm

Now we have a positive ID of a bug. The "true" message is generatd by SetEnVar, but it isn't supposed to. Neither can I find any environment variable set by the SetEnvVar. Instead of creating an environmnet variable, it always pops up a "true" message box.

jwm0vmh
Newbie
Posts: 9
Joined: Sun Jul 06, 2003 3:44 pm

SetEnvVar Popup

Post by jwm0vmh » Tue Feb 01, 2005 1:38 pm

Bob Hansen wrote:I get the same result. The window that comes up shows the message "true".

I tried adding CloseWindow>Macro* as next command, but the "true" message comes up before that line of script is executed.
Bob,
That cleared up the problem for me in both the test script I posted and the application script.

Thanks,
JM

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Tue Feb 01, 2005 1:44 pm

Please note this problem has now been fixed in 7.3.07.
MJT Net Support
[email protected]

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Thu Feb 03, 2005 3:08 pm

armsys wrote:Neither can I find any environment variable set by the SetEnvVar. Instead of creating an environmnet variable, it always pops up a "true" message box.
The SetEnvVar function sets the value of an environment variable for the current process. The environment variable will therefore only be available to the same process or it's child processes. You won't therefore see it in Windows. Only the same script or a script, process or other application spawned by that script will be able to see that environment variable using GetEnvVar.

You would have the same result if you created an environment variable using the Set command in a CMD.EXE session. Those variables will only exist in that session. Close the session and those environment variables will no longer exist. Any process started by that CMD.EXE session will have access to them.

For more info see:
http://msdn.microsoft.com/library/en-us ... iables.asp

The bug where the "true" message box pops up has been removed in 7.3.07.
MJT Net Support
[email protected]

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Thu Feb 03, 2005 4:27 pm

Maybe in the future a switch can be added to make the SetEnvVar variable persistent?

In the meantime, using XSET is a useful utility to do many things with environment variables. An excerpt from the literature:
XSET main goal is productivity. It lets you write full-featured batch files in just a few minutes. You do not have to learn a new language or environment, you just call XSET when you need it in your usual batch files.

XSET is the most powerful environment variable manipulation program you have ever seen. It also has a very easy and intuitive user interface (very close to the SET command) you only need to use the functionality you need, you do not have to worry about the functionality you do not use. It is not a resident program; so it will not interfere with any of your other applications.
-----------------------------------
XSET major features

Catch the output of any command (internal or external) or program and put it into an environment variable

Manages variable contents of more than 128 characters (your path can now be as long as you want)

Built-in commands to modify the output of a program or a string given on the command-line (extract a part of a string, ...)

Built-in full floating-point calculation functionality: You can program incremental loops, input a calculation string and output the resulting number, ...

Built-in commands to give you access to a lot of system data (date, time, file attributes, CPU type,...)

Built-in commands to clear the whole environment or restore a previously saved one

High-level input/output user interface (line-editing, colors, windows, boxes, ...)
You can use XSET now in Macro Scheduler with Run Program>
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts