Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
General
»
for..next
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Benchmark regular vs SIMD...
by
Martin_fr
[
Today
at 04:50:30 pm]
Klondike solitaire Part 2
by
TBMan
[
Today
at 04:16:40 pm]
Как правильно создать на ...
by
pmralbuquerque
[
Today
at 03:46:15 pm]
FPC Unleashed (inline var...
by
cdbc
[
Today
at 03:45:31 pm]
Cannot get FTP to work
by
rvk
[
Today
at 03:32:36 pm]
Problem with upgrading to...
by
wp
[
Today
at 03:15:03 pm]
How to wait until a WebDA...
by
Lutz Mändle
[
Today
at 02:44:10 pm]
Anubis's website security...
by
ALLIGATOR
[
Today
at 01:23:59 pm]
Anubis activated
by
rvk
[
Today
at 12:45:50 pm]
Can Lazarus support Auto-...
by
Martin_fr
[
Today
at 12:33:34 pm]
TFONT and related init ?
by
jamie
[
Today
at 12:17:36 pm]
ERROR: The current FPC ha...
by
Thaddy
[
Today
at 11:53:06 am]
Run code during DLL load
by
LemonParty
[
Today
at 11:48:20 am]
GocciaScript: JavaScript ...
by
Tomxe
[
Today
at 11:39:14 am]
text color visible
by
hedgehog
[
Today
at 10:36:48 am]
SYnEdit lose cursor
by
Martin_fr
[
Today
at 09:50:48 am]
Portable verion of FPC an...
by
marcov
[
Today
at 09:46:14 am]
P.I.S.S. a PlugIn-framewo...
by
cdbc
[
Today
at 09:41:18 am]
paszlib. Feature request ...
by
LemonParty
[
Today
at 08:09:37 am]
Death of the Power User
by
440bx
[
Today
at 05:47:41 am]
Linking a PortAudio stati...
by
bbrx
[May 20, 2026, 08:02:20 pm]
IDE Windows Centered
by
zeljko
[May 20, 2026, 01:51:37 pm]
QuotedStr
by
wp
[May 20, 2026, 12:52:30 pm]
LazNodeEditor (visual nod...
by
gidesa
[May 20, 2026, 12:36:09 pm]
TMemoryStream, manual mem...
by
marcov
[May 20, 2026, 12:16:31 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: for..next (Read 1082 times)
BubikolRamios
Sr. Member
Posts: 397
for..next
«
on:
August 24, 2025, 08:35:03 pm »
Code: Pascal
[Select]
[+]
[-]
i
:
=
0
;
number
:
=
0
;
for
i
:
=
number
to
(
number
+
1
)
do
begin
end
;
it executes twice but i is in both cases 0 ?
Logged
lazarus 3.2-fpc-3.2.2-win32/win64
marcov
Administrator
Hero Member
Posts: 12866
FPC developer.
Re: for..next
«
Reply #1 on:
August 24, 2025, 08:41:24 pm »
If the compiler determines that the value of I is not used, it can optimise it. If you then look with the debugger, the value doesn't make sense, but that is not really a problem.
What did you exactly do to test ?
Logged
BubikolRamios
Sr. Member
Posts: 397
Re: for..next
«
Reply #2 on:
August 24, 2025, 08:43:05 pm »
Quote from: marcov on August 24, 2025, 08:41:24 pm
What did you exactly do to test ?
Put breakpoint, check i value that I'm using inside loop.
EDIT: ahh, my bad. Thanks for opening my eyes (-: number and i switched places in my brain.
«
Last Edit: August 24, 2025, 08:46:00 pm by BubikolRamios
»
Logged
lazarus 3.2-fpc-3.2.2-win32/win64
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
General
»
for..next
TinyPortal
© 2005-2018