Terror Factor
2010-02-25 14:29:15
Hi,
I'm having issues with a for loop, here's the code:
aantalTabs is the number of tabs I want to use. middenTab is the middle x coordinate of the first tab. tabLengte is the total length of all the tabs, divided by the number of tabs.
The function should work, in another procedure it initializes all the tabs(tab1, refresh, tab2, refresh, tab3, refresh, ..), and that works without any problem.
However, with this code, it errors with tab 5(or e=4). This part works:
Another issue that I've noticed, while I tried to fix the script:
I've commented the second part of the procedure(5 to x), and tried to make the first part into this: "e:=4 to 4 do". That doesn't work, it ALWAYS starts at zero, even when I tried "e:=3 to 4 do". I have no idea why:/
I'm having issues with a for loop, here's the code:
procedure submittvs;
begin
for e:= 0 to 4 do //tab1 tà 5
begin
tab(middenTab+i*tabLengte);
tvs;
tab(middenTab+(i+aantalTabs-5)*tabLengte);
home;
writeln('tab '+IntToStr(e+1));
end;
//for e:= 5 to aantalTabs-1 do //tab6 to x
//begin
//tab(middenTab+i*tabLengte);
//tvs;
//tab(middenTab+(i-5)*tabLengte);
//home;
//writeln('tab '+IntToStr(e+1));
//end;
end;The goal of the code is to go tab one(in chrome), submit something, go to the 5th last tab, refresh it. Afterwards it should go to tab 2, submit, go to the 5th last tab, refresh, etc.aantalTabs is the number of tabs I want to use. middenTab is the middle x coordinate of the first tab. tabLengte is the total length of all the tabs, divided by the number of tabs.
The function should work, in another procedure it initializes all the tabs(tab1, refresh, tab2, refresh, tab3, refresh, ..), and that works without any problem.
However, with this code, it errors with tab 5(or e=4). This part works:
begin
tab(middenTab+i*tabLengte);
tvs;, but the second part tab(middenTab+(i+aantalTabs-5)*tabLengte);
home;
writeln('tab '+IntToStr(e+1));
end; doesn't. Instead of clicking the last tab, it clicks on the plus-button in chrome. Technically that shouldn't even be possible(the coordinates NEVER get to there:/).Another issue that I've noticed, while I tried to fix the script:
I've commented the second part of the procedure(5 to x), and tried to make the first part into this: "e:=4 to 4 do". That doesn't work, it ALWAYS starts at zero, even when I tried "e:=3 to 4 do". I have no idea why:/