Hi all, I have to say I'm scoobied with this one. I've revisited some code from a year ago, and two identical loops are giving very different results...
Loop one is this:
let>clear1=1
repeat>clear1
let>extcount[%clear1%]=0
let>size[%clear1%]=0
add>clear1,1
writeln>c:\datacheck\progress.txt,null,Clear1 is %clear1%
until>clear1,20
which, as expected, gives this:
Clear1 is 2
Clear1 is 3
Clear1 is 4
Clear1 is 5
Clear1 is 6
Clear1 is 7
Clear1 is 8
Clear1 is 9
Clear1 is 10
Clear1 is 11
Clear1 is 12
Clear1 is 13
Clear1 is 14
Clear1 is 15
Clear1 is 16
Clear1 is 17
Clear1 is 18
Clear1 is 19
Clear1 is 20
loop2 is a cut and paste code in a different subroutine:
let>clear2=1
repeat>clear2
let>extcount[%clear2%]=0
let>size[%clear2%]=0
add>clear2,1
writeln>progress.txt,result4,clear2 is %clear2%
until>clear2,20
which gives this:
clear2 is 0
clear2 is 0
clear2 is 0
clear2 is 0
ad infinitum...
also, I had problems with a variable setting to 0.
any comments/suggestions/howls of derision would be appreciated.
Thanks, Ian
Running 7.4.005 pro on XP
Identical code giving errors...
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
My bet is that somewhere in your script prior to loop 2 you have inadvertantly created a variable called 1 which has been set to 0. Before the loop add MessageModal>1 and see what it displays. If I'm right step through with the watch list open and look closely at all places you have used a numeric 1 - one of those maybe meant to be a return var and as such 1 has become 0.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?