On 9/11/19 1:06 AM, Ralf Quint wrote:
On 9/10/2019 4:26 PM, wkitt...@windstream.net wrote:
On 9/9/19 10:11 AM, James Richters wrote:
Pascal doesn't have things like step...
hunh??? i don't think that's right but i'm just catching up after several 10+
hours days of $job...
i know that i've
I reported it here:
https://bugs.freepascal.org/view.php?id=36065
James
>Actually, the original code used two VARs, not typed CONST. One VAR was
>initialized and one was not. I think this is a bug and should be fixed.
>As Jonas already pointed out:
>"var i : longint = 0;" is interna
Actually, the original code used two VARs, not typed CONST. One VAR was
initialized and one was not. I think this is a bug and should be fixed.
As Jonas already pointed out:
"var i : longint = 0;" is internally handled using the same code path as
"const i : longint = 0", and typed constants c
from my Huawei phone Original Message --------Subject: Re: [fpc-pascal] Illegal counter variable?From: DougC To: FPC-Pascal users discussions CC: The last messages have wandered off topic somewhat. Can we stick to the original request, which was why the handling of the two declarat
James Richters schrieb am Mi., 11. Sep.
2019, 16:24:
> How do you get ‘By’ to work? I have downto working but if I try ‘By’ I
> get
>
>
>
> Fatal: Syntax error, "DO" expected but "identifier BY" found
>
Did you see anywhere that said that this bug report was resolved and the
patch integrated i
t
Sent: Tuesday, September 10, 2019 7:26 PM
To: fpc-pascal@lists.freepascal.org
Subject: Re: [fpc-pascal] Illegal counter variable?
On 9/9/19 10:11 AM, James Richters wrote:
> Pascal doesn't have things like step...
hunh??? i don't think that's right but i'm just catching up after
How do you get ‘By’ to work? I have downto working but if I try ‘By’ I get
Fatal: Syntax error, "DO" expected but "identifier BY" found
If FPC is going to support downto and by, why not also support changing the
control variable when not in {$Mode TP} as well, and just make a note that
If step is wanted, it's easy enough:
For n:=a to b Do
Begin
if n Mod step <> 0 then Continue;
...
p.s. make that
if (n-a) Mod step <> 0 then Continue;
for cases where a is not a multiple of step.
Martin.
___
fpc-pascal maillist -
I am not aware of any Pascal implementation that does have a STEP
parameter for FOR loops
If step is wanted, it's easy enough:
For n:=a to b Do
Begin
if n Mod step <> 0 then Continue;
...
Martin.
___
fpc-pascal maillist - fpc-pascal@lis
Christo Crause schrieb am Mi., 11. Sep. 2019,
09:54:
>
> On Wed, Sep 11, 2019 at 7:06 AM Ralf Quint wrote:
>
>> On 9/10/2019 4:26 PM, wkitt...@windstream.net wrote:
>> > On 9/9/19 10:11 AM, James Richters wrote:
>> >> Pascal doesn't have things like step...
>> >
>> > hunh??? i don't think that's
On Wed, Sep 11, 2019 at 7:06 AM Ralf Quint wrote:
> On 9/10/2019 4:26 PM, wkitt...@windstream.net wrote:
> > On 9/9/19 10:11 AM, James Richters wrote:
> >> Pascal doesn't have things like step...
> >
> > hunh??? i don't think that's right but i'm just catching up after
> > several 10+ hours days
On 9/10/2019 4:26 PM, wkitt...@windstream.net wrote:
On 9/9/19 10:11 AM, James Richters wrote:
Pascal doesn't have things like step...
hunh??? i don't think that's right but i'm just catching up after
several 10+ hours days of $job...
i know that i've written code in the past that did use s
On 9/9/19 10:11 AM, James Richters wrote:
Pascal doesn't have things like step...
hunh??? i don't think that's right but i'm just catching up after several 10+
hours days of $job...
i know that i've written code in the past that did use something to step X
numbers per run through the look a
-pascal On Behalf Of Markus
Greim
Sent: Monday, September 9, 2019 1:32 PM
To: FPC-Pascal users discussions
Subject: Re: [fpc-pascal] Illegal counter variable?
James,
not every body is using a GHz machine. I am , for example, programming a 80186
in an embedded system with very limited
loop) when it detects this, and use the more efficient optimized code when it
detects that it is able to use it?
James
-Original Message-
From: fpc-pascal On Behalf Of Bernd
Oppolzer
Sent: Monday, September 9, 2019 10:46 AM
To: FPC-Pascal users discussions
Subject: Re: [fpc-pascal] Illega
AFAIK these is the standard behavior since the first PASCAL versions.
We must not change it. It prevents a lot of side effects, and PASCAL is NOT C
without brackets!
Use while or repeat instead!
>From Niklaus Wirths last 2004 Oberon manual:
https://people.inf.ethz.ch/wirth/ProgInOberon2004.
.freepascal.org
Cc: Mattias Gaertner
Subject: Re: [fpc-pascal] Illegal counter variable?
On Mon, 9 Sep 2019 19:27:49 +0200
Bart wrote:
> On Mon, Sep 9, 2019 at 4:54 PM Jonas Maebe
> wrote:
>
> > "var i : longint = 0;" is internally handled using the same code
> &
On Mon, 9 Sep 2019 19:27:49 +0200
Bart wrote:
> On Mon, Sep 9, 2019 at 4:54 PM Jonas Maebe
> wrote:
>
> > "var i : longint = 0;" is internally handled using the same code
> > path as "const i : longint = 0", and typed constants cannot be used
> > as counter variables. This is indeed probably a
On Mon, Sep 9, 2019 at 4:54 PM Jonas Maebe wrote:
> "var i : longint = 0;" is internally handled using the same code path as
> "const i : longint = 0", and typed constants cannot be used as counter
> variables. This is indeed probably a bug.
D7 does not allow this for global variables: "for loop
September 9, 2019 10:46 AM
To: FPC-Pascal users discussions
Subject: Re: [fpc-pascal] Illegal counter variable?
Am 09.09.2019 um 16:11 schrieb James Richters:
> I just don't see why having the limitation, there is no technical
> reason that the for loop couldn't change that I can
On 09/09/2019 15:11, James Richters wrote:
If (I>86) And (I<95) then Continue;
What does continue do exactly? Loop back to the beginning of the for loop
right away?
Hi James,
Yes in effect -- it jumps forward to the test at the end of a loop. Very
useful.
See: https://www.freepascal.org/d
On 2019-09-09 11:30, James Richters wrote:
Can someone please tell me why this happens?
Var
I : Longint = 0;
Begin
For I := 1 to 6 Do
Writeln(I);
End.
This gives me :
initialize.pas(4,5) Error: Illegal counter variable
initialize.pas(6,4) Fatal: There were 1 errors compiling module,
stop
Am 09.09.2019 um 16:11 schrieb James Richters:
I just don't see why having the limitation, there is no technical reason that
the for loop couldn't change that I can see.. especially since it works in TP
mode.
The original reason why some Pascal implementations had this limitation:
for perfo
8:53 AM
To: fpc-pascal@lists.freepascal.org
Subject: Re: [fpc-pascal] Illegal counter variable?
On 09/09/2019 13:38, James Richters wrote:
> Var
> I:Byte;
> Begin
>I:=57;
>For I := I to 100 do
> Begin
> If I=87 then
>I:=95;
>
The last messages have wandered off topic somewhat.
Can we stick to the original request, which was why the handling of the two
declarations differed?
Doug C.___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/c
On 09/09/2019 13:38, James Richters wrote:
Var
I:Byte;
Begin
I:=57;
For I := I to 100 do
Begin
If I=87 then
I:=95;
Write(I,' ');
End;
End.
Why not:
Var
I:Byte;
Begin
I:=57;
For I := I to 100 do
Begin
If (I>86) And (I<95) the
>That page only talks about assigning the loop var *inside* the loop, which is
>forbidden.
You can re-assign the loop variable if you are in {$Mode TP} it works perfectly
fine to re-assign the for variable inside the loop, and I use that extensively,
I have TP units specifically so I can do tha
19 5:59 AM
To: fpc-pascal@lists.freepascal.org
Cc: Mattias Gaertner
Subject: Re: [fpc-pascal] Illegal counter variable?
On Mon, 9 Sep 2019 11:44:05 +0200
SPRL AFOR wrote:
> Hi.
>
> Index variable can neither be initialized nor computed. Read
> https://wiki.lazarus.freepascal.org/FOR..DO
On Mon, 9 Sep 2019 11:44:05 +0200
SPRL AFOR wrote:
> Hi.
>
> Index variable can neither be initialized nor computed. Read
> https://wiki.lazarus.freepascal.org/FOR..DO
That page only talks about assigning the loop var *inside* the loop,
which is forbidden.
James question is about the differen
Hi.
Index variable can neither be initialized nor computed. Read
https://wiki.lazarus.freepascal.org/FOR..DO
Antonio
Le 09/09/2019 à 11:30, James Richters a écrit :
Can someone please tell me why this happens?
Var
I : Longint = 0;
Begin
For I := 1 to 6 Do
Writeln(I);
End.
This give
30 matches
Mail list logo