Posted: 26th Jun 2007 16:44
OK,i am getting this error alot lately,as i cannot seem to make ANY For - Next loop inside functions,or it will give me some weird error it cant find a structure.

I thought lets reboot,but it still gives me the error.Here is a screenshot attached,any fix for this?

DBP V1.062
Posted: 26th Jun 2007 16:52
Maybe a mistyped function?
Its hard to see on that picture.
Posted: 26th Jun 2007 16:56
I could upload a bigger version,but it is one that did work before,but all of a sudden it did not want to compile For - Next loops anymore inside functions,and i dont really want to mess up the FreshGUI functions,as those worked perfectly.
Posted: 26th Jun 2007 17:41
[1] Trying to get contextual help on code with an image is pure larceny at its finest.

as i cannot seem to make ANY For - Next loop inside functions,or it will give me some weird error it cant find a structure


[2] what code test can you supply that demonstrates the problem in a neat little package.

[3] why are you using 6.2, as well?, Im not one to upgrade so easily as im a 6.3 kid, but why 6.2?
Posted: 26th Jun 2007 17:45
It looks like you might be trying to use a global variable as an iterator, which doesn't work.

It'd be helpful if you would actually show the line of code that the error appears on, rather than hiding it.
Posted: 26th Jun 2007 19:49
Hmm,didnt know that that line was so important,but it SHOULD WORK as i didnt code it,and it worked before.Just my compiler quits wanting to compile For-Next loops within functions after a while,and will only do so again if i make a new project,and copying it will let it give the error again.

for y=list_min to list_max

thats the line though,FreshGUI 2.1 code,and it should work,didnt use any of those variables.If you need my full code ill provide it.
Posted: 27th Jun 2007 0:44
It sounds to me like you've made 'y' a global variable somewhere.
Posted: 27th Jun 2007 4:21
Just skimming - and that is a weird restriction. Global Var can not be used as iterator. hmm. Not restrictive I suppose but its a first for me... and like my "signature" states - I know a lot of programming languages... but admittedly they all have their quirks.

Jason P Sage
Posted: 27th Jun 2007 8:22
I made it global indeed,because it was important.Didnt know that was bad.
Posted: 27th Jun 2007 9:34
You should use globals sparingly if possible. I've never even tried to use one as an iterator.