
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do While Loop
I'm not sure if this is a problem with the syntax of my Do...While loop, or with the way I'm using variables in my script, but I've hit a brick wall and need some help.
I am currently writing a trigger mechanism for my Qlikview schedule and need my script to continue running until the trigger file has been altered.
So, I have one variable (vCurrentTriggerDate) taking the timestamp from the actual trigger file, and a second variable taking the timestamp stored in a QVD file (vStoredTriggerDate).
My loop reads like this:
Do while '$(vCurrentTriggerDate)'='$(vStoredTriggerDate)';
let vCurrentTriggerDate = Filetime('$(vCRSPath)$(vMCPath)TriggerTest.txt');
LOOP;
The idea being, that when the timestamp on 'TriggerTest.txt' changes, the script should drop out of the loop. However, I don't think it is ever re-evaluating the contents of vCurrentTriggerDate, and therefore continues looping forever.
Has anyone got any ideas how to overcome this?
Many thanks


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Andrew,
Try this ...
let vStoredTriggerDate=filetime({file});
let run = 1;
let pass = 1;
Do while run = 1
if vStoredTriggerDate<>Filetime({file}) then
let run = 0;
endif;
//testing
trace $(pass): Running;
sleep 100;
let pass = pass + 1;
LOOP;
flipside

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks so much for this. Worked a treat (with a little tinkering).
