James,
not every body is using a GHz machine. I am , for example, programming a 80186
in an embedded system with very limited speed an RAM.
But I understand thats not a general argument.
But look at MISRA C. Its a big set of rules for "real" save C programming, more
or less now the stan
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.
Maybe there's no technical reason it doesn't work... it's just set to not work
to make it compatible with other pascal programs?
-Original Message-
From: fpc-pascal On Behalf Of Mattias
Gaertner via fpc-pascal
Sent: Monday, September 9, 2019 1:32 PM
To: fpc-pascal@lists.freepascal.org
C
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
Yes, today such limitations do seem too restrictive, I wonder if the reasons
for the restrictions have become obsolete. You would have to have a really
slow computer with very limited resources to optimize loops to the point of
reducing functionality like this, and the tendency with modern pc's
On 9/8/2019 2:09 AM, Michael Van Canneyt wrote:
For relative measurements, units are not needed. A ratio has no units, the
only thing that is required is that the units for both measurements are the
same (which should be the case on a single platform).
That's fair. GetTickCount is also the bes
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
If (I>86) And (I<95) then Continue;
What does continue do exactly? Loop back to the beginning of the for loop
right away? I didn't even know there was such a command.. it's not mentioned
here:
https://wiki.lazarus.freepascal.org/FOR..DO
only break is mentioned.
As I said, there are ways aro
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
I don't understand what difference it makes if I assign I :=0 with the variable
declaration or If I was using I for something else.. It's irrelevant what the
condition of I was before the for loop, just as it's irrelevant that the status
of a variable is before you assign it to something.I
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
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, stopping
initialize.pas(0) Fatal: Compilation ab
Hi all,
I've put some code, documentation and examples online for the
serialization-library.
Very rough, but I think it shows my ideas. You can find it here:
https://wiki.freepascal.org/cnocstream
The name, classnames etc may change. Everyone with good ideas, they are
welcome.
There is n
19 matches
Mail list logo