Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Could you explain this?

Author
Message
Takis76
19
Years of Service
User Offline
Joined: 9th Apr 2005
Location: Greece
Posted: 4th Jun 2006 17:33
With this code I could show allways the lp variable changes from
1 to 5 with loop.

And it is stucks at 6, without looping

I didn't say to add one more. The range is from 1 to 5 not 6





Let's change this one with this code

With this code "aa" variables is returned from loopfunc() function and its stored in the "lp" variable and takes the value of "aa"
in this case programm starts from 0 to 5 not 6 but jumps to 5
at once and does not changes from 1 to 5 with loop.





If it was correct I would see

1
2
3
4
5
1
2
3
4
5
.
.
.

Is this a bug?
monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 4th Jun 2006 18:06
The loop in the function is looping five times and incrementing the value by this amount then returning it, so the 'lp' variable is going to be five everytime. The following code shows how this could be done.



My W.I.P project
Takis76
19
Years of Service
User Offline
Joined: 9th Apr 2005
Location: Greece
Posted: 4th Jun 2006 21:16
Thank you very much , I did something.

It helped me a little.

But I made a lot of change in my code.

Login to post a reply

Server time is: 2024-09-25 01:31:29
Your offset time is: 2024-09-25 01:31:29