Forum Index  ViceVersa HOME         FAQ and Knowledge Base

 FAQForum FAQ   SearchSearch Forum  RegisterRegister 
 ProfileProfile   Log inLog in 

Writing an exit code using before script to stop comparison

 
Post new topic   Reply to topic     Forum Index -> Support
Author Message
Smiffy



Joined: 30 Jan 2011
Posts: 1

PostPosted: Sun Jan 30, 2011 12:40 pm    Post subject: Writing an exit code using before script to stop comparison Reply with quote

Hi, please excuse my vb knowledge here, which is somewhat shaky. I am trying to set up a message box that runs before comparison which asks if you want to execute the vv profile or just exit. I use vvengine to run my profiles. The help file states that "If a custom script returns an exit code that is not equal to zero, ViceVersa stops comparison and execution". So I am trying to go down this route, by setting the VV_EXIT_CODE in a script before comparison. Its not working though. Below is my script. Can anyone help on what I might need to do? Again, apologies for poor vb knowledge.

Set WshShell = WScript.CreateObject("WScript.Shell")

dim stopexecutioncode
dim mymsg
dim msgcontent

stopexecutioncode = 1

msgcontent = "The teaching files synchronisation is about to start. Do you want to run the synchronisation?" & vbNewLine _
& vbNewLine _
& "If yes, once the teaching files have synchronised automatically a message will appear reporting success or errors. A window will then appear to manually check personal files. Either execute this or just close it if there is nothing to synchronise. A message will confirm that the synchronisation is complete at the end."

mymsg = MsgBox(msgcontent, 4, "Start Synchronisation?")

If mymsg = 7 Then
WshShell.Environment("PROCESS").Item("VV_EXIT_CODE") = stopexecutioncode
End If

Thanks.
Back to top
TGRMN Software
Site Admin


Joined: 10 Jan 2005
Posts: 8763

PostPosted: Mon Jan 31, 2011 1:10 am    Post subject: Reply with quote

Hi, VVEngine runs profiles in hidden mode: the message box would not appear. I think it would be better to use VVScheduler.
thanks
_________________
--
TGRMN Software Support
http://www.tgrmn.com
http://www.compareandmerge.com
Back to top
Guest






PostPosted: Mon Jan 31, 2011 10:30 pm    Post subject: Reply with quote

On the contrary, the message box does appear in all scripts attached to profiles executed through VVEngine. So that part works fine. What I need to identify is how to set the exit code and stop the profile running via the script. It looks like it should be quite possible. Any ideas?
Back to top
TGRMN Software
Site Admin


Joined: 10 Jan 2005
Posts: 8763

PostPosted: Tue Feb 01, 2011 4:11 am    Post subject: Reply with quote

Hi,

use

WScript.Quit (1)

to return an exit code not equal to 0 and stop ViceVersa.

WScript.Quit (0)

returns 0 and lets ViceVersa continue.


http://msdn.microsoft.com/en-us/library/fw0fx1aw%28v=vs.85%29.aspx


thanks

---
www.tgrmn.com
_________________
--
TGRMN Software Support
http://www.tgrmn.com
http://www.compareandmerge.com
Back to top
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Support All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group
Copyright © TGRMN Software. TGRMN Software products: