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
TStringGrid displaying a ...
by
jcmontherock
[
Today
at 04:39:51 pm]
Getting name / line of ca...
by
Prime
[
Today
at 04:23:19 pm]
Qt does not position form...
by
Alexx2000
[
Today
at 03:52:43 pm]
Application.QueueAsyncCal...
by
Thaddy
[
Today
at 03:17:23 pm]
FPC Unleashed (inline var...
by
Fibonacci
[
Today
at 02:03:21 pm]
Windows API Hooking/DLL I...
by
Thaddy
[
Today
at 01:08:56 pm]
How do 'with' statements ...
by
Thaddy
[
Today
at 01:00:07 pm]
TComboBoxEx & TCheckCombo...
by
Paolo
[
Today
at 11:28:00 am]
DataPort or Synpase stat...
by
serbod
[
Today
at 09:30:51 am]
SynEdit auto End of line ...
by
Martin_fr
[
Today
at 09:08:36 am]
Show Case: WritingTool
by
ginoo
[
Today
at 08:47:02 am]
How to view the TODO list...
by
Thaddy
[
Today
at 07:16:27 am]
Scripts to generate ofici...
by
dbannon
[
Today
at 02:25:56 am]
P.I.S.S. a PlugIn-framewo...
by
cdbc
[
Today
at 01:20:44 am]
International Pascal Cong...
by
Mike.Cornflake
[May 09, 2026, 06:45:37 pm]
SpreadSheet Add Chart Lin...
by
eldonfsr
[May 09, 2026, 06:19:33 pm]
How to access inherited m...
by
Thaddy
[May 09, 2026, 04:12:38 pm]
Anubis activated
by
LemonParty
[May 09, 2026, 03:46:01 pm]
RunFormula: math expressi...
by
LeP
[May 09, 2026, 03:39:53 pm]
Setting canvas offset wit...
by
jamie
[May 09, 2026, 03:14:04 pm]
Limiting Search in TSelec...
by
jamie
[May 09, 2026, 03:09:21 pm]
using make with a differe...
by
Thausand
[May 09, 2026, 02:41:39 pm]
FreeBSD 13/14: RTL dirent...
by
Fred vS
[May 09, 2026, 02:33:11 pm]
Problems with form.AutoSc...
by
OH1KH
[May 09, 2026, 12:07:44 pm]
AVRPascal – free code edi...
by
ackarwow
[May 09, 2026, 09:23:14 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: for..next (Read 1081 times)
BubikolRamios
Sr. Member
Posts: 392
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: 12837
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: 392
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