Re: [fpc-pascal] for loop variable value reliable after loop?

2015-10-05 Thread Santiago A.
El 05/10/2015 a las 11:48, Dennis escribió: > > var i , n : integer; > > for i := 1 to 100 do begin >if IntArray[i] > 100 then begin > n := i; > break; >end; > end; > > writeln('The '+IntToStr(i)+' item in the array > 100'); > //can we be always sure the value i is always the same

Re: [fpc-pascal] Methods for autoupdating fpc programs?

2015-10-05 Thread Flávio Etrusco
On Mon, Oct 5, 2015 at 1:58 PM, Jürgen Hestermann wrote: > > > Am 2015-10-04 um 19:11 schrieb mic...@gmail.com: >>> >>> But that makes no sense to me. If the OS is designed to potentially >>> remove >>> running programs (or parts of it) from memory it cannot allow overwriting >>> the file on disk

Re: [fpc-pascal] Methods for autoupdating fpc programs?

2015-10-05 Thread Mattias Gaertner
On Sun, 4 Oct 2015 21:06:57 +0200 Mattias Gaertner wrote: > On Sun, 4 Oct 2015 19:17:14 +0100 > Graeme Geldenhuys wrote: > > > On 2015-10-04 19:14, Graeme Geldenhuys wrote: > > > I can't remember what it is called, but I can find the name if > > > I search for it > > > > I think it was called

Re: [fpc-pascal] Methods for autoupdating fpc programs?

2015-10-05 Thread Jürgen Hestermann
Am 2015-10-04 um 19:11 schrieb mic...@gmail.com: But that makes no sense to me. If the OS is designed to potentially remove running programs (or parts of it) from memory it cannot allow overwriting the file on disk in any case. When it does so, it cannot remove parts from memory because it may

Re: [fpc-pascal] for loop variable value reliable after loop?

2015-10-05 Thread Dmitry Boyarintsev
Delphi 7 follows ISO rule. The loop: for i := 1 to 100 do begin if IntArray[i] > 100 then begin n := i; break; end; end; writeln('The '+IntToStr(i)+' item in the array > 100'); Doesn't produce a warning. The loop: n:=-1; for i := 1 to 100 do begin if (IntArray[i] > 100) and (

Re: [fpc-pascal] for loop variable value reliable after loop?

2015-10-05 Thread Sven Barth
Am 05.10.2015 15:43 schrieb "Adriaan van Os" : > > Sven Barth wrote: > >> The for-loop-variable contains a valid value after the loop if the loop was left using a break or goto (this does not seem to be documented in FPC's language reference guide, but AFAIK it is in Delphi; also don't know what th

Re: [fpc-pascal] for loop variable value reliable after loop?

2015-10-05 Thread Dennis
Adriaan van Os wrote: Sven Barth wrote: The for-loop-variable contains a valid value after the loop if the loop was left using a break or goto (this does not seem to be documented in FPC's language reference guide, but AFAIK it is in Delphi; also don't know what the ISO standard says about

Re: [fpc-pascal] for loop variable value reliable after loop?

2015-10-05 Thread Adriaan van Os
Sven Barth wrote: The for-loop-variable contains a valid value after the loop if the loop was left using a break or goto (this does not seem to be documented in FPC's language reference guide, but AFAIK it is in Delphi; also don't know what the ISO standard says about this...). ISO/IEC 7185

Re: [fpc-pascal] for loop variable value reliable after loop?

2015-10-05 Thread Michael Van Canneyt
On Mon, 5 Oct 2015, Jonas Maebe wrote: Michael Van Canneyt wrote on Mon, 05 Oct 2015: On Mon, 5 Oct 2015, Sven Barth wrote: The for-loop-variable contains a valid value after the loop if the loop was left using a break or goto (this does not seem to be documented in FPC's language refere

Re: [fpc-pascal] for loop variable value reliable after loop?

2015-10-05 Thread Jonas Maebe
Michael Van Canneyt wrote on Mon, 05 Oct 2015: On Mon, 5 Oct 2015, Sven Barth wrote: The for-loop-variable contains a valid value after the loop if the loop was left using a break or goto (this does not seem to be documented in FPC's language reference guide, but AFAIK it is in Delphi; also d

Re: [fpc-pascal] for loop variable value reliable after loop?

2015-10-05 Thread Michael Van Canneyt
On Mon, 5 Oct 2015, Sven Barth wrote: Am 05.10.2015 11:48 schrieb "Dennis" : var i , n : integer; for i := 1 to 100 do begin if IntArray[i] > 100 then begin n := i; break; end; end; writeln('The '+IntToStr(i)+' item in the array > 100'); //can we be always sure the value i

Re: [fpc-pascal] for loop variable value reliable after loop?

2015-10-05 Thread Sven Barth
Am 05.10.2015 11:48 schrieb "Dennis" : > > > var i , n : integer; > > for i := 1 to 100 do begin >if IntArray[i] > 100 then begin > n := i; > break; >end; > end; > > writeln('The '+IntToStr(i)+' item in the array > 100'); > //can we be always sure the value i is always the same as

[fpc-pascal] for loop variable value reliable after loop?

2015-10-05 Thread Dennis
var i , n : integer; for i := 1 to 100 do begin if IntArray[i] > 100 then begin n := i; break; end; end; writeln('The '+IntToStr(i)+' item in the array > 100'); //can we be always sure the value i is always the same as n? Even when the compiler optimizes it and uses a cpu registe