Le 18/04/2021 à 16:10, James Richters via fpc-pascal a écrit :
RE: [fpc-pascal] Directory Tree I getuFileVirtualTree.pas(533,9)
Error: identifier idents no member "DefaultEncoding"
It seems, using svn blame, that DefaultEncoding has been added in
FreePascal source trunk on the svn server on
Indeed, I think it's difficult (if possible) to change the behaviour of
the multiselection this way.
The TTreeview.MultiSelectStyle property allows you to change from
CtrL+Click to Shift+Click.
https://lazarus-ccr.sourceforge.io/docs/lcl/comctrls/tmultiselectstyle.html
To make the multi
If you just select files, as Bart stated in another message, I think
TShellTreeView will be more adequate and easier than TTreeView (actually
TShellTreeView is a file tree specific descendent TTreeView).
In TTreeView (and TShellTreeView) you can enable multiselection by
adding
TStringList works pretty much like an inifile section.
The index corresponds to the line number in you text block.
The Names property corresponds to the part of the line before the '=' char.
The ValueFromIndex property corresponds to the part of the line after
the '=' char.
So if you line i
I have updated the VirtualTreeView example with sub-totals of time.
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Le 22/04/2021 à 23:17, James Richters via fpc-pascal a écrit :
For some reason the ODT file wants to know if I want to translate it
from French, and while the font is “Courier New” for anything I would
type into the document, the font of the text itself is “Liberation Serif”
If I change the
Le 22/04/2021 à 22:17, James Richters via fpc-pascal a écrit :
RE: [fpc-pascal] Directory Tree
My system could not find DejaVuSans,
You can find it in
C:\lazarus\fpc\3.2.0\source\packages\fcl-report\demos\fonts.
May be you don't need to install the font, just add on the line below
where
May be something like "Snap!" ?
https://snap.berkeley.edu/snap/snap.html#present:Username=trev1315=plane%202
https://snap.berkeley.edu/project?user=trev1315=plane%202
On my own, I think starting with Lazarus and GUI apps would be far easier.
If you create a new app from a template, you can
I've forgotten to add the link to "Snap!" manual:
https://snap.berkeley.edu/snap/help/SnapManual.pdf
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Ooops, may be I hit reply too fast.
It looks like when you write " TObjB = class(TObjA, IBBB)" you just
implement IAAA twice.
If you comment out IBBB
TImpB = class(TImpA{, IBBB})
public
procedure CallOfB;
//procedure IBBB.MethodB = CallOfB;
end;
then the "No matching
Le 15/08/2021 à 00:43, Dmitry Boyarintsev via fpc-pascal a écrit :
Why is interface implementation not inherited, if explicit
implementation is used.
I guess this is because you can implement an interface through
delegation too:
https://www.freepascal.org/docs-html/ref/refse48.html
type
I made a few tests on Ubuntu 64 bits (arch x86_64) with variations on a
small test program:
var
E2: Byte= 3;
E1: LongWord= 1;
E: QWord;
begin
E:= (1000*E1) shl E2;
writeln( 'E2', E2);
writeln( 'E1', E1);
writeln( 'E', E);
end.
In the assembly window, shl is computed
I don't know if it's related, but I experienced a similar problem a few
years ago.
It's a console dll written in Freepascal and compiled for Win64 and
Linux (Ubuntu). It uses several threads and uses CheckSynchronize to
make calls in the main thread.
The dll is loaded and used by a 4gl
Wonderful !
Thank you very much for all your work and all the work of the FPC /
Lazarus team !
And Merry Christmas for all !
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
Le 29/08/2022 à 01:41, James Richters via fpc-pascal a écrit :
If a special function is needed for some COM thing or weird Winapi thing, then
that function should be part of the unit that needs it, not modifying the
generic function intended to be used for general purpose applications output
Le 01/09/2022 à 07:50, Michael Van Canneyt via fpc-pascal a écrit :
The file seems corrupt. I tried several programs, none managed to open
it.
Indeed more than corrupt. For me, file is just empty (size 0 byte)
___
fpc-pascal maillist -
Le 22/10/2022 à 23:37, Bo Berglund via fpc-pascal a écrit :
If I could get at each output that mosquitto_cli writes into a script or such
then I would be good to go.
Maybe with a redirection ( > ) to a file in bash ?
___
fpc-pascal maillist -
I couldn't verify the code but it should be relatively close to your
c++ example. Not sure of the width of int type, I supposed it's 16 bits
wide:
function CRC16( crc: Word; buf: PByte; len: Word; Poly:Word=$A001): Word;
var
pos: Word;
i: Word;
begin
for pos:= 0 to len-1
do
Le 23/10/2022 à 23:59, Bo Berglund via fpc-pascal a écrit :
Might get stuck at readln(s) if no messages are sent, i.e. no carriage-return
coming along?
AFAIK readln is blocking, right?
I've made a test with mosquitto_pub, it seems there is a line ending at
the end of each message, so you will
If your main program is a console program, it's likely that you'll need
to call CheckSynchronize( from unit Class) in your main program/main
thread from time to time in order to allow the execution of calls of
methods specified in Synchronize in your thread (which reads mqtt messages).
I'm
May be with a pipe | ?
Something like
mosquitto_sub -h 192.168.117.131 -F '@Y-@m-@d @H:@M:@S ; %t ; %p' -t '#' |
SomePascalProgram
This way you'll receive the output of mosquitto_sub on the standard
input of SomePascalProgram.
I've tested locally on an Apache log with
tail -f
Le 23/10/2022 à 22:50, Jean SUZINEAU via fpc-pascal a écrit :
This way you'll receive the output of mosquitto_sub on the standard
input of SomePascalProgram.
A very small example for SomePascalProgram for use with pipe, reading
on standard input and writing on standard output :
var
s
May be by escaping the spaces with ^ ?
Something like: MyFileName:= StringReplace(MyFileName, ' ', '^ ',
[rfReplaceAll]);
^ is the escape char for cmd.exe but may be it is active in this context
too ?
Le 20/09/2022 à 18:31, James Richters via fpc-pascal a écrit :
I just tried it that
As Bart suggested, you can use too the for/in loop: for s in sl do
WriteLn( s);
For example:
var
sl: TStringList;
s: String;
begin
sl:= TStringList.Create;
try
sl.Add('1');
sl.Add('2');
for s in sl do WriteLn( s);
finally
FreeAndNil(
May the solution to your problem should be just :
TDataExample
=
record
case integer
of
0: (mData: Int64);
1: (mByte: packed array[0..7] of Byte);
2: (UnionField: Int64);
end;
?
You aren't going to define a getter or setter method on your property,
just an
For this particular error I think you should just follow the advice of
compiler in the error message :
Le 14/08/2022 à 11:49, Skybuck Flying via fpc-pascal a écrit :
// normal/standard property
property StandardField : integer read mStandardField write
mStandardField;
An if you eventually need a read only UnionField :
TmByte= packed array[0..7] of Byte;
TDataExample2
=
record
internal
:
record
case integer
of
0: (mData: Int64);
1: (mByte: TmByte);
end;
property mByte : TmByte read internal.mByte;
Le 01/05/2023 à 17:00, Bo Berglund via fpc-pascal a écrit :
I have created a shellscript with the same command string
May be running directly your script in bash:
RunCommand('/bin/bash', ['your_script.sh' ], OutData)
___
fpc-pascal maillist -
I don't have an example at hand but I think you should run a bash
interpreter, something like :
RunCommand('/bin/bash', ['-c', ListCmd], OutData)
but I'm not 100% sure.
There is a good documentation at:
https://wiki.freepascal.org/Executing_External_Programs
May be you need to split your
... I wouldn't be surprised that James's program is a console one, not
using TForm nor any windows message loop to process WM_ messages, but I
may be wrong.
It can be more tricky in this case.
___
fpc-pascal maillist -
May be you could get the source code of i2ctransfer from i2c-tools and
compare it with the code in i2c.pas ?
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Le 12/06/2023 à 19:05, Steve Litt via fpc-pascal a écrit :
Busted! I used Pascal 1984-1993
So I guess you are not familiar too with the "Result" variable which
appeared with Delphi 1 in 1995 if I remember correctly.
nextt:= num;
can be written to as :
Result:= num;
Hello, I have a hard time trying to understand what you want to test.
In your functions, you are using a record, not a class or a pointer to
record or an object.
The personrecord just behave in your parameters and return value as an
Integer or a String, and your fillchar doesn't write
Oops, I hit "Send message" too quickly.
The only difference in the second code is:
- personrecord renamed to personclass and declared as "personclass = class"
- "newp:= personclass.Create;" added in function newperson
Of course for a clean code, you'll need to call something like
According to you other posts, I won't be surprised that you think in a
C/C++ way.
This doesn't change anything in your last example, but particularly :
nextt := num;
doesn't behave like in C :
return num;
In pascal I think the equivalent would be :
nextt := num; exit;
Le 17/06/2023 à 20:07, Travis Siegel via fpc-pascal a écrit :
Is this a relatively new addition to fpc or something?
I 've just found it in my Delphi 7 code (and code very likely written
for Delphi 4), so I think it's there since at least 2000-2001 ...
May be it appeared with Delphi 1 ?
It sounds like "SpVoice := CreateOleObject('SAPI.SpVoice');" is failing
and then SpVoice is nil ?
May be try with an OleVariant instead of a simple Variant ? (i.e declare
var SpVoice: OleVariant; )
___
fpc-pascal maillist -
I've just made a small test with the old Borland Delphi 7.0 build 4453
from 2002 :
...
type
TForm1 = class(TForm)
m: TMemo;
procedure FormCreate(Sender: TObject);
end;
...
procedure TForm1.FormCreate(Sender: TObject);
var
GG: Extended;
S: String;
begin
GG :=
Le 09/02/2024 à 20:53, Jonas Maebe via fpc-pascal a écrit :
However, adding support for an option called -CFMax or similar should
be no problem.
It would be very nice to compile old code
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
Le 17/12/2023 à 17:47, Adriaan van Os via fpc-pascal a écrit :
Turbo Pascal (5.5) defines
label = digit-sequence .
Are you sure ?
I had a doubt and I had a look in some very old source code from 1990
made with tp 5.5, it seems you could have letters in labels.
Excerpt of the code:
Le 15/12/2023 à 10:39, Adriaan van Os via fpc-pascal a écrit :
I don't see a semicolon in the formal syntax.
May be included in the ' "DO" statement ' ?
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
Le 08/01/2024 à 13:51, Peter B via fpc-pascal a écrit :
or if not, is there another way to
turn it on in the textmode IDE?
No idea. Its easy enough if you compile from the command line.
fpc -Os -XX hello.pas
If stripping is not on by default, also use -Xs
I guess that in the textmode IDE
Le 22/02/2024 à 15:08, Thomas Kurz via fpc-pascal a écrit :
But it's supported on Linux but not on Windows? Huh?
As far as I know Extended is not supported on Linux.___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
I see that Wikipedia is not very clear on this, you just find "x86"
mentioned, but for Pascal: "this Extended type is available on 16, 32
and 64-bit platforms, possibly with padding"
https://en.wikipedia.org/wiki/Extended_precision
___
fpc-pascal
I didn't tested but I imagine it could be done with something like this ?
type
TWindow_Class= class of TWindow;
begin
...
(myClass as TWindow_Class).CreateNewWindow( );
___
fpc-pascal maillist -
101 - 145 of 145 matches
Mail list logo