Forum

Please note that you can subscribe to the individual forums. A subscription for news only covers the news.

Notifications
Clear all

calling multiple procedures after openprogam  

   RSS

0

First of all, my compliments on this great program! I'm currently trying to rewrite a script from V2 that I've enjoyed a few years ago (Master JOHN), working on 4.0 B5 now. Just at the very start of rewriting though. And I can't solve the issue below, so I hope you can help me with this. Not sure if it is a bug or whether I'm doing something wrong.

I'm trying to write a 'solver' procedure that should help fix issues when a status needs to be reset or a flag needs to be removed/set. Idea is to run the procedure every time the program starts.

 

So in events I call 'OpenProgram=welcome'

In welcome I have the following lines:

[procedure-welcome]

;this line runs fine every time the program is opened

SetFlag=versionvm 

I think this line isn't needed, but figured I'd try
Select=All ;

; this line only runs the first time a script starts (so after all reports are deleted)
procedure=solver 

; this line runs fine every time the program is opened
procedure=maxscreen

 

Just for completeness, the flags and procedures look like this:

[procedure-maxscreen]
NewStatus=maxscreen
EndReport=Ready to start, Sir, i've maximized the screen

[status-maxscreen]
title=Maximize_the_screen_and_then.................._report_so

[procedure-solver]
;this procedure can be used in order to solve problems
If=august,day09
SetFlag=test
;NotAfter=19:00

[flag-test]
text=test success1
duration=00:02

[flag-versionvm]
text=This script requires version 4.0 beta 3 or higher of VirtualMaster
duration=00:01

 

I'm wondering why the 'test' flag only is set once and not every time the program starts.

I've done some testing and it seems to be related to the condition. If I remove the statement if=.. it does seem to run. Is this intended behavior or did I misinterpret how this condition should work?

 

 

3 Answers
0

Can it be that the flag is not removed. If you close the program and start it again within the two minutes, the flag will still be there from the last run.

A way to help debugging such situations is to use the keyword WriteReport in the beginning of each procedure, to write the procedure name. It will help see what is going on. And study the report carefully to see which flags are set when the program start, and in which sequence. 

Sven

@admin
Thanks, I'll try to get more info from the report.
Sorry for not being clear on what actually happens. You are correct: the flag is set once and it does get removed after 2 minutes. However it isn't set again when restarting the program afterwards.
I also tried to set the flag without duration: it obviously remains in that case. But if I then use the removeflag code in the solver, it won't remove the flag. Everything I tried so far seems to indicate the procedure, if a month/day condition is included, won't run again (at least not within a couple of minutes).

I'll let you know whether the writereport keyword gave any useful information

@admin
Just to confirm my initial expectations: when I used WriteReport to create a line of text for every procedure that is reached, I noticed that in the first run my solver procedure is reached and correctly executed. however, the next time the program starts, the procedure isn't reached/executed. The welcome procedure is correctly executed and the maxscreen status is reached. So odly enough it only seems to skip the 'solver'.

The only way to make sure the 'solver' does run is by not having the 'if' condition. If I comment that out, the procedure is reached/executed every time I run the program.
I can imagine this is intended behavior as you may only want something to execute once on a particular day, so I can work around this by just not making it day specific and make sure that when whatever issue is solved, it is commented out again.
So it's not really a problem I think. I was just surprised as apparently things behaved differently in the early day.
Thanks again!

0

It is not intended. august and day09 should work as normal flags. Can you verify in the report that they are set when the program starts and before the solver is called? 

To do more, I must have a script that causes the problem and the corresponding report. If you can't solve it yourself, you can send them to sven.brg@gmail.com.

At the moment I am quite busy with the new version and my own sub, so I don't know how fast I will be able to look at it. 

Sven

0

The problem is solved in the new beta 8.

Sven