Re: [fpc-pascal] Illegal counter variable?

2019-09-11 Thread wkitty42
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

Re: [fpc-pascal] Illegal counter variable?

2019-09-11 Thread James Richters
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

Re: [fpc-pascal] Illegal counter variable?

2019-09-11 Thread DougC
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

Re: [fpc-pascal] Illegal counter variable?

2019-09-11 Thread scoxb...@shaw.ca
Yes, off topic. The initial poster's code had the loop variable declared as an initialized constant. Not as a true variable. No FPC in hand, I can't test if setting 'assignable typed constants = true' would permit the use of an initialized typed constant or not. Sent from my Huawei phone Or

Re: [fpc-pascal] Illegal counter variable?

2019-09-11 Thread Sven Barth via fpc-pascal
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

Re: [fpc-pascal] Illegal counter variable?

2019-09-11 Thread James Richters
I don't know what the syntax would be if it did have a way to do a step https://wiki.lazarus.freepascal.org/FOR..DO "In Pascal, the for loop can only count in increments (steps) of 1" James -Original Message- From: fpc-pascal On Behalf Of wkitt...@windstream.net Sent: Tuesday, Septemb

Re: [fpc-pascal] Illegal counter variable?

2019-09-11 Thread James Richters
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

Re: [fpc-pascal] Illegal counter variable?

2019-09-11 Thread Martin Wynne
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 -

Re: [fpc-pascal] Illegal counter variable?

2019-09-11 Thread Martin Wynne
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

Re: [fpc-pascal] Illegal counter variable?

2019-09-11 Thread Sven Barth via fpc-pascal
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

Re: [fpc-pascal] Illegal counter variable?

2019-09-11 Thread Christo Crause
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