Hi Thomas,
The error is not the file content after "end.".
The error is not having the expected "end;" after "begin".
This works ok:
_
program test;
begin
end;
end.
abc 123
_
Martin.
___
fpc-pasca
I've been using ELSE in IF statements and in CASE statements for 25
years without realising there was a problem. What a dim-wit I have been.
Martin.
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailma
On 17/06/2023 19:07, Travis Siegel via fpc-pascal wrote:
This is interesting, because it's the first time I've ever seen "break"
as a valid command in pascal, and I've been using pascal since the
mid/late 80s. All kinds of dialects too, and I've never seen break as a
keyword. C, Python, Perl,
On 14/04/2023 01:31, James Richters via fpc-pascal wrote:
Does anyone know what's up with the Pause key in Windows?
Is there some way to tell if it was pushed?
Hi James,
//
Tform.FormKeyDown(Sender:TObject; var Key:Word; Shift:TShiftState);
begin
if Key=VK_PAUSE
On 12/09/2022 15:37, James Richters via fpc-pascal wrote:
So I could just do this?
Index:= MyStringlist.IndexOfName(SearchName);
If Index >=0 then
MyValue := MyStringlist[Index].ValueFromIndex;
Hi James,
I would probably do
try
with MyStringList do MyValue:=ValueFromIndex[IndexOfN
On 12/09/2022 14:16, James Richters via fpc-pascal wrote:
The problem with the for in loop is that I need the index.
Hi James,
You don't need a loop for that:
index:=MyStringlist.IndexOfName;
see:
https://www.freepascal.org/docs-html/rtl/classes/tstrings.indexofname.html
martin.
On 10/09/2022 17:01, James Richters via fpc-pascal wrote:
For Loop := 0 to MyStringList.Count-1 do
It would be nice to not have the -1
I don't understand what is wrong with Count-1, but you can get the
highest index like this if you wish:
high_index:=Length(Trim(MyStringList.Text))-Length(
On 18/05/2021 20:59, Bo Berglund via fpc-pascal wrote:
I have a pretty sizable console app written with Delphi 15 years ago but ported
to Linux using FreePascal (3.2.0) with Lazarus (2.0.12) as IDE.
I have the same problem with high CPU usage for a 20-year-old Delphi App
compiled in Lazarus(2.
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
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 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
I have only 2 eyes, so I'm going to find 3 screens a problem.
Martin.
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
var
b: boolean;
o: TObject;
begin
// this compiles, but should fail:
if o is TComponent and b then ;
It will compile if $BOOLEVAL is on the default (-) because the result
can be determined without considering precedence, see:
https://www.freepascal.org/docs-html/prog/progsu4.ht
Delphi mode is very useful.
It means old code from earlier versions of Delphi (in my case Delphi5)
can be open-sourced and made available via Lazarus to anyone interested,
without their needing to get an expensive copy of the latest Delphi.
Martin.
The Lazarus version is mostly working in Lazarus, but instead of everything
happening before the form is loaded, is there a way I could make the form
first, then just start processing everything, so that my messages I send to
memo1 show up as it's processing? I'm guessing I need to move my p
Hi Mattias,
Thanks for your reply.
'TWinControl.WMSize loop detected, the widgetset does not like the LCL
bounds or sends unneeded wmsize messages'.
Can you create a bug report with an example to reproduce the loop?
Sorry, I don't know how to do that. However, it is very easy to replicate:
This appears to be a topic for the Lazarus list, as it appears that
you're using the Lazarus LCL: laza...@lists.lazarus-ide.org
There you may obtain adequate assistance.
Giuliano
Thanks. Sorry for posting to the wrong list.
Martin.
___
fpc-pascal
If I create a child form by setting Parent:=other_form; in FormCreate,
it cannot be dragged to a new position by the user.
If I then remove the top and left anchors by setting Anchors:=[]; in
FormCreate (or in the Object Inspector) so that it can be dragged, I get
this exception:
'TWinContro
19 matches
Mail list logo