Lower "var" speeds up code ??

W

Wayne-I-M

Hi

var vis;
var sdiv;
var evno = ee.selectedIndex;
for (var ii = 1;ii<11;ii++) {
sdiv="Event" + ii;
FP_changeProp(/*id*/sdiv,0,'style.display','none');
}
if (evno >= 1) {
if (evno > 10) evno = 11;
sdiv = "Event" + evno;
vis = "block";
FP_changeProp(/*id*/sdiv,0,'style.display','block');
}
}

__________________________________

Line 4 ( for (var ii = 1;ii<11;ii++) {)
Seems to causing the problem - if change to = 1;ii<6;ii++) { then the speed
is "much" faster.
Also line 9 if (evno > 10) evno = 11;
If changed to if (evno > 6) evno = 7;

__________________________________


I can't work this out as all this does is restrict the number of options in
the list then the choice of dependent fields

Not sure why this would be unless it's the actual speed of the processor -
not very likely.
 
6

'69 Camaro

Hi, Wayne.
Line 4 ( for (var ii = 1;ii<11;ii++) {)
Seems to causing the problem - if change to = 1;ii<6;ii++) { then the
speed
is "much" faster.

Yup. Five loops is faster than 10 loops. It executes about twice as fast,
I'll wager. ;-)
I can't work this out as all this does is restrict the number of options
in
the list then the choice of dependent fields

If the operation needs 10 loops rather than five, then you won't be able to
to replace the 11 with a 6.
Not sure why this would be unless it's the actual speed of the processor -
not very likely.

Look a little closer at which numbers you're using. It's not the
processor's fault it's twice as slow.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 
W

Wayne-I-M

Ha Ha Ha

what do I know.

The code is

}
if (evno >= 1) {
if (evno > 10) evno = 11;
sdiv = "Event" + evno;
FP_changeProp(/*id*/sdiv,0,'style.display','block');
}
}

All this does (as you will know) is limit the upper variable to to the
second number - I don't really want an upper limit but (like most people on
"all" these forums) but if I have to have one I at least want one the is
relevant (to the number of options available. Of course it's got to loop
"but" the speed of the loops is "really" slow.

But as I have now been informed - LoL

Is that when I made the "stuff" I missed off some of the div enders and it
wasn't the variables or the number of loops after all.

I really should get another job ya know.

Oh well sorted now (I think / hope)

--
Wayne
Manchester, England.



'69 Camaro said:
Hi, Wayne.
Line 4 ( for (var ii = 1;ii<11;ii++) {)
Seems to causing the problem - if change to = 1;ii<6;ii++) { then the
speed
is "much" faster.

Yup. Five loops is faster than 10 loops. It executes about twice as fast,
I'll wager. ;-)
I can't work this out as all this does is restrict the number of options
in
the list then the choice of dependent fields

If the operation needs 10 loops rather than five, then you won't be able to
to replace the 11 with a 6.
Not sure why this would be unless it's the actual speed of the processor -
not very likely.

Look a little closer at which numbers you're using. It's not the
processor's fault it's twice as slow.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 
D

David W. Fenton

var vis;
var sdiv;
var evno = ee.selectedIndex;
for (var ii = 1;ii<11;ii++) {
sdiv="Event" + ii;
FP_changeProp(/*id*/sdiv,0,'style.display','none');
}
if (evno >= 1) {
if (evno > 10) evno = 11;
sdiv = "Event" + evno;
vis = "block";
FP_changeProp(/*id*/sdiv,0,'style.display','block');
}
}

Er, what purpose does it serve to post this code in an Access
newsgroup? It isn't VBA. This is not an Access question.
 
W

Wayne-I-M

Hi Dave

I know thats why I also posted
___________________
ooops - sorry

wrong forum
___________________

The other posts were in answer to Gunny's posts. Sorry if this upset
anyone. Basically I messed up the div enders and thought it was the increase
in loops that was slowing down the "stuff" (not access) - but hey ho - life
goes on.

And the best thing is, is that is a bank holiday today - no work. Off to
the beach with kids. (no doubt it will rain as soon as we arrive but >>>)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top