Re: [Lazarus] Email sending program using Indy stopped working - seems to be an SSL problem

2024-01-14 Thread Carlos E. R. via lazarus

On 2024-01-14 12:20, Bo Berglund via lazarus wrote:

On Sat, 13 Jan 2024 17:03:55 +0100 (CET), Michael Van Canneyt via lazarus
 wrote:


You could also use Synapse. I always prefer synapse over Indy.



So I have now verified that I cannot use Indy10 for email sending anymore :( ...

I have used Indy since a very long time like 20 years or so when dealing with
Internet accesses. So I am not used to other ways.

Now I have looked around for valid examples which will work like my send
function but using Synapse but the result is confusing.


I think you have alternatives.

You can seek and find a windows light mail server program that runs in 
the same machine as your program. You do not need a full fledged one. 
It's tasks is solely to receive email from your program and send it to 
your ISP. I can not suggest one, you would have to ask on some windows 
support group. The advantage is not having to modify your code.


Or you can try to find another type of windows light mail server, of the 
type that you pass it a file to send as email, similarly to what is done 
on Linux with sendmail. You have to modify your code, but your program 
will not need to talk smtp. Fire and forget.


In Linux there are also mail client applications, those that are used by 
a user to type an email and send it, that can also be called on scripts. 
Maybe they exist on Windows too.


Thunderbird can do this:

thunderbird.exe -compose "to='em...@domain.com',subject='Some 
Subject',preselectid='id1',body='Message Body',attachment='File.txt'"


(in batch, add "start /b" or it will stop waiting for TB to return)

https://stackoverflow.com/questions/6253701/thunderbird-compose-email-in-a-batch-script-continue-to-next-command

http://forums.mozillazine.org/viewtopic.php?t=3033072

--
Cheers / Saludos,

Carlos E. R.
(from 15.4 x86_64 at Telcontar)



OpenPGP_signature.asc
Description: OpenPGP digital signature
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] How to list available serial orts on Ubuuntu?

2022-11-28 Thread Carlos E. R. via lazarus

On 2022-11-28 14:08, Bo Berglund via lazarus wrote:

On Mon, 28 Nov 2022 13:31:12 +0100, Giuliano Colla via lazarus
 wrote:


Hope that it helps,


Thanks, it does.

I had thought of this but it looked like an overly complicated way given that
the list of tty* ports using ls -l /dev/tty* on my system comprises no less than
98 hits


Please see my post. It is not tty*


--
Cheers / Saludos,

Carlos E. R.
(from 15.3 x86_64 at Telcontar)



OpenPGP_signature
Description: OpenPGP digital signature
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] How to list available serial orts on Ubuuntu?

2022-11-28 Thread Carlos E. R. via lazarus

On 2022-11-28 11:31, Bo Berglund via lazarus wrote:

I haved a debugging tool program created on Windows and I am orting it to Linux
Ubuntu.
It seems to build just fine except for a combobox fill function which uses the
Windows way of populating the selectoer box with the serial ports available on
the system.


...



I have looked at /dev/tty* but it lists a large number of items which makes it
impossible for me. I do not belive all of´them are real serial ports...


I think they are /dev/ttyS*, but also /dev/ttyUSB* or /dev/ttyACM*, 
which is not all /dev/tty* :-D




What can I do to get a selector for real serial ports on Ubuntu.


Maybe (googled for "name of serial port in linux"):

https://www.cyberciti.biz/faq/find-out-linux-serial-ports-with-setserial/

What it says does not work in my machine (which has a true serial port)

dmesg | grep tty

because the log buffer has rotated out the boot section. But:

Telcontar:~ # zgrep -i 'ttyS' /var/log/messages-20221126.xz
<0.6> 2022-11-17T18:18:26.555284+01:00 Telcontar kernel - - - [ 
1.072472] 00:05: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 
16550A
<0.6> 2022-11-19T11:58:45.529903+01:00 Telcontar kernel - - - [ 
1.082125] 00:05: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 
16550A

Telcontar:~ #


But that is too complicated for your code, it is rather for a user to do 
manually.


This other method works:

Telcontar:~ # setserial -g /dev/ttyS[0123]
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: unknown, Port: 0x02f8, IRQ: 3
/dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4
/dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3
Telcontar:~ #

But it doesn't find *any* serial port. Not USB based ones unless you 
tell it to check those. Maybe you better ask the user to name the port, 
and you test to find out if it is true.


--
Cheers / Saludos,

Carlos E. R.
(from 15.3 x86_64 at Telcontar)



OpenPGP_signature
Description: OpenPGP digital signature
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] UNSUBSCRIBE PLEASE

2020-03-18 Thread Carlos E. R. via lazarus

On 18/03/2020 09.53, Vincent, Dean via lazarus wrote:

Regards*
You have to follow the procedure, which is described in the headers of 
your email:


List-Unsubscribe: ,
 

--
Cheers / Saludos,

Carlos E. R.
(from 15.1 x86_64 at Telcontar)



signature.asc
Description: OpenPGP digital signature
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Multi-platform console application, how to handle file paths?

2019-10-29 Thread Carlos E. R. via lazarus
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 29/10/2019 12.25, Bo Berglund via lazarus wrote:
> I am writing a console application intended to be portable between
> Windows and Linux and it uses files on the file system for
> configuration and also for processing data.
>
> Since the path delimiter is different on Unix and Windows I believe
> I have to handle this in my code, but how?

Thinking...

Define a something case {what system} array of strings. Depending on
the system detected, you use one or the other array of (constant?)
strings, that contains the paths. Assuming they are fixed.


- -- 
Cheers / Saludos,

Carlos E. R.
(from 15.1 x86_64 at Telcontar)
-BEGIN PGP SIGNATURE-

iF0EARECAB0WIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCXbgi9AAKCRC1MxgcbY1H
1dj2AJ9Qoqusdw0jaoFvLDSmiblv1bhjVQCfccLWxQ0mQO926h0mtAcS4tSADUk=
=/Ojl
-END PGP SIGNATURE-
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Command line interpretation on Linux console program...

2019-04-11 Thread Carlos E. R. via lazarus
On 11/04/2019 23.40, Bo Berglund via lazarus wrote:
> On Thu, 11 Apr 2019 22:30:44 +0200, "Carlos E. R. via lazarus"
>  wrote:
> 
>> In fact, if "videosplitcmb" is your program, it doesn't even see the
>> second part, it is bash who stops at the ";" before calling "videosplitcmb".
> 
> Thanks,
> rather than taking on Linux I changed the separator to comma since the
> values are numeric whole seconds so a decimal separator would not come
> into play anyway..
> Works fine...

That assumes that you will never operate that program on different
languages than yours, because, for instance, here the decimal separator
is a comma.

-- 
Cheers / Saludos,

Carlos E. R.
(from 15.0 x86_64 at Telcontar)



signature.asc
Description: OpenPGP digital signature
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Command line interpretation on Linux console program...

2019-04-11 Thread Carlos E. R. via lazarus
On 11/04/2019 22.03, Bo Berglund via lazarus wrote:

> 2) Another issue concerns the parsing of command line parameters.
> Originally I had set it up to use ; as separator for the two time
> values of a clip, starttime and duration (in seconds) as follows:
> t1234;500 for a duration 500 s clip starting at 1234 s into the source
> video.
> But for some reason the ParamCount variable contains 3 when the
> command line looks like this:
> 
> videosplitcmb -x -iorg.mp4 -t0;1768 -t2420;2972 -otest4.mp4
> 
> There should really be 5 parameters: -t, -i, -t, -t, -o
> 
> Why is ; treated as some kind of block for the command line parsing?

Bash also stops at the ';', it is a command separator. It is like
entering two commands like this:

videosplitcmb -x -iorg.mp4 -t0
1768 -t2420;2972 -otest4.mp4

You have to escape the ';', like this: '\;'


In fact, if "videosplitcmb" is your program, it doesn't even see the
second part, it is bash who stops at the ";" before calling "videosplitcmb".

-- 
Cheers / Saludos,

Carlos E. R.
(from 15.0 x86_64 at Telcontar)



signature.asc
Description: OpenPGP digital signature
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Built console app on Linux, but won't run on another Linux machine

2018-10-28 Thread Carlos E. R. via Lazarus
On 27/10/2018 14.32, Bo Berglund via Lazarus wrote:
> On Sat, 27 Oct 2018 14:03:16 +0200, "Carlos E. R. via Lazarus"
>  wrote:
> 
>> On 27/10/2018 13.58, Bo Berglund via Lazarus wrote:
>>
>>> I tried to upgrade, dist-upgrade the server to remove the logon
>>> greeting about available updates then rebooted.
>>> No difference.
>>>
>>> Then I tried by installing xfce4 desktop, thinking that this would
>>> deposit the X11 stuff into the system. But it did not solve the
>>> problem even though the start error message now changed to:
>>
>> IMHO, that's the wrong approach.
>>
>> You have to remove the dependency, somehow, not fulfill it.
> 
> That is the problem, I don't know how to remove a dependency like
> this...

I don't know either how to find it, but installing "missing" libraries
on the server will not help, rather the contrary.


-- 
Cheers / Saludos,

Carlos E. R.
(from 42.3 x86_64 "Malachite" at Telcontar)



signature.asc
Description: OpenPGP digital signature
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Built console app on Linux, but won't run on another Linux machine

2018-10-27 Thread Carlos E. R. via Lazarus
On 27/10/2018 13.58, Bo Berglund via Lazarus wrote:

> I tried to upgrade, dist-upgrade the server to remove the logon
> greeting about available updates then rebooted.
> No difference.
> 
> Then I tried by installing xfce4 desktop, thinking that this would
> deposit the X11 stuff into the system. But it did not solve the
> problem even though the start error message now changed to:

IMHO, that's the wrong approach.

You have to remove the dependency, somehow, not fulfill it.

-- 
Cheers / Saludos,

Carlos E. R.
(from 42.3 x86_64 "Malachite" at Telcontar)



signature.asc
Description: OpenPGP digital signature
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Multilang application and syncing .po files

2018-06-19 Thread Carlos E. R. via Lazarus
On 2018-06-19 13:51, Maxim Ganetsky via Lazarus wrote:
> 
> 
> 19.06.2018 14:37, Carlos E. R. via Lazarus пишет:
>> On 2018-06-19 13:09, Tomáš Emresz via Lazarus wrote:
>>> Hello,
>>>
>>> i  have  done generating .po files, could translate it through PoEdit,
>>> but  -  when  i add some RS or component, Lazarus update only main .po
>>> file,  not  .cs.po etc. So could Lazarus update these files too, or is
>>> there  any  merge tool for this ? Of course, I understand, that I must
>>> translate  this  string  after,  but  this  time,  I  sync  this files
>>> manually, which is bad.
>>>
>>> Any idea ?
>>
>> I'll answer as translator, I do not yet know how Lazarus handles this.
>>
>> The programmer should only change the .pot files.
> 
> Lazarus handles all this itself. Main .po file is actually is what you
> mean by .pot (historically it has .po extension instead of .pot).

Well, IMHO that is wrong.

The .pot file should contain all the messages without any translation,
it is the master file. And the .po files are the translations, one per
language. The .pot file is maintained by the programmers, the .po are
maintained by the translators.

Anyway, msgmerge can handle that situation, too.


-- 
Cheers / Saludos,

Carlos E. R.
(from 42.3 x86_64 "Malachite" at Telcontar)



signature.asc
Description: OpenPGP digital signature
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Is it possible to find the location of an EAccessViolation, with Lazarus?

2018-05-13 Thread Carlos E. R. via Lazarus
On 2018-05-13 06:06, Cyrax via Lazarus wrote:
> On 12/05/18 21:04, Carlos E. R. via Lazarus wrote:


>> Although the child is not using pipes :-?
>>
>>
>>
> 
> If the child process outputs something (text or something else), then it
> is using stdout pipe. And if you want access to this output, then you
> need to set poUsePipes enum in the TProcess.Options so TProcess can set
> up IO redirection correctly.

Ah. Then it is the parent who is setting an implicit pipe. That is an
important "detail" that I didn't notice/read about.


> Also do not forget read TProcess.StdErr pipe, otherwise there is change
> for strange behaviour. Or add poStderrToOutPut to TProcess.Options.

Well, of course I did not set it up, because I did not see it in the
example I was following or in the documentation. Thanks for telling me!

<http://wiki.freepascal.org/TProcess>
<http://wiki.freepascal.org/Executing_External_Programs#TProcess>
<https://www.freepascal.org/docs-html/fcl/process/tprocess.html>


-- 
Cheers / Saludos,

Carlos E. R.
(from 42.3 x86_64 "Malachite" at Telcontar)



signature.asc
Description: OpenPGP digital signature
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Is it possible to find the location of an EAccessViolation, with Lazarus?

2018-05-12 Thread Carlos E. R. via Lazarus
On 2018-05-12 18:35, Orbán Árpád via Lazarus wrote:
> Hi Carlos,
> 
> Try add poUsePipes to TProcess.Options:
> 
>>  AProcess := TProcess.Create(nil);
>>     try
>>    AProcess.Executable := '/usr/local/bin/egctl';
>>    AProcess.Parameters.Add('Regleta');
>>    AProcess.Parameters.Add('off');
>>    AProcess.Parameters.Add('off');
>>    AProcess.Parameters.Add('off');
>>    AProcess.Parameters.Add('off');
> 
>     AProcess.Options := AProcess.Options + [poUsePipes];
> 
>>
>>    AProcess.Execute;

Ah. Thanks. I had commented that out by mistake. Actual code was:

  {$ifDEF Dummy}
  AProcess.Parameters.Add('Regleta');
  AProcess.Options := [poWaitOnExit, poUsePipes];
  {$else}
  AProcess.Parameters.Add('Regleta');
  AProcess.Parameters.Add('off');
  AProcess.Parameters.Add('off');
  AProcess.Parameters.Add('off');
  AProcess.Parameters.Add('off');
  {$endIf}

And "Dummy" was not defined.

Although the child is not using pipes :-?

-- 
Cheers / Saludos,

Carlos E. R.
(from 42.3 x86_64 "Malachite" at Telcontar)



signature.asc
Description: OpenPGP digital signature
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Is it possible to find the location of an EAccessViolation, with Lazarus?

2018-05-12 Thread Carlos E. R. via Lazarus
Hi,

a program of mine crashed with:

Exception at 00401B4A: EAccessViolation:
Access violation.


Is it possible to find the location line of that address?


Very long ago, with turbopascal, it was possible to type the address of the 
fault in a box in the compiler, which would build again the source and stop at 
the exact location. I do not see similar thing in Lazarus. Did I miss it?



I know where it happened, more or less, from the messages on screen and syslog.
Maybe someone here can see the problem in the code.


procedure TMyApplication.DoRebootRouter;
 {See  
  for the doc on calling a program and getting its output.}
   const
 BUF_SIZE = 2048; // Buffer size for reading the output in chunks
   var
 AProcess : TProcess;
 OutputStream : TStream;
 BytesRead: longint;
 Buffer   : array[1..BUF_SIZE] of byte;
 ExitCode,
 ExitStatus   : Integer;
begin
   LastRouterRebootTimestamp:= Now;
   inc(RebootTimes);
   ExitCode := -1;
   AProcess := TProcess.Create(nil);
   try
  AProcess.Executable := '/usr/local/bin/egctl';
  AProcess.Parameters.Add('Regleta');
  AProcess.Parameters.Add('off');
  AProcess.Parameters.Add('off');
  AProcess.Parameters.Add('off');
  AProcess.Parameters.Add('off');

  AProcess.Execute;  < this does execute.
  OutputStream := TMemoryStream.Create;
  repeat
 BytesRead := AProcess.Output.Read(Buffer, BUF_SIZE);
 OutputStream.Write(Buffer, BytesRead)
  until BytesRead = 0;
  ExitCode:= AProcess.ExitStatus;
  ExitStatus:= AProcess.ExitStatus
   finally
  AProcess.Free;
   end;

   syslog(log_info, 'Called %s, got EC: %d ED: %d'#10, ['egctl', ExitCode, 
ExitStatus]);   <  this part doesn't execute.
   Writeln('Got exitcode ', AProcess.ExitCode, ' ExitStatus: ', 
AProcess.ExitStatus);



The external program runs fine.

The screen output was:

Last sucessfull ping was more than 60 seconds ago, rebooting the router.
Exception at 00401B4A: EAccessViolation:
Access violation.
socket 1 - off  <=== child program
socket 2 - off
socket 3 - off
socket 4 - off


Syslog entries are these:

<16.6> 2018-05-12T07:25:18.455969+02:00 Isengard WatchDog - - -  WatchDog MARK! 
Status: Router 1 (F/T 0/48) Google 1 (F/T 0/8) Rebooting 0  Reboots 0
<16.6> 2018-05-12T07:47:20.514116+02:00 Isengard WatchDog - - -  Last 
sucessfull ping was more than 60 seconds ago, rebooting the router.
<16.6> 2018-05-12T07:47:20.515184+02:00 Isengard WatchDog - - -  Ending

The second line indicates that the procedure shown above is called.

The third line comes from here:


destructor TMyApplication.Destroy;
begin
   ping.Free;
   syslog(log_info,'Ending',[1234]);
   closelog;
   inherited Destroy;
end;   



Ideas?


-- 
Cheers / Saludos,

Carlos E. R.
(from 42.3 x86_64 "Malachite" at Telcontar)



signature.asc
Description: OpenPGP digital signature
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Sending e-mail from within Lazarus

2018-05-10 Thread Carlos E. R. via Lazarus
On 2018-05-10 15:31, Brian via Lazarus wrote:
> Does anybody have a working example of sending e-mail from a Lazarus
> program through their ISP's mail server (which requires SSL/TLS) that
> they'd be willing to share with me?

I intend to code this soon, but I will simply call "mailx", an external
program to do it. The classic method was to call the sendmail binary.

I use Linux, you did not say what you use.

-- 
Cheers / Saludos,

Carlos E. R.
(from 42.3 x86_64 "Malachite" at Telcontar)



signature.asc
Description: OpenPGP digital signature
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Cloning standard output to text file

2018-05-04 Thread Carlos E. R. via Lazarus
On 2018-05-04 19:30, Marco van de Voort via Lazarus wrote:
> On Fri, May 04, 2018 at 01:31:50PM +0200, Carlos E. R. via Lazarus wrote:
>> Now I have to figure out how to write both to file and screen :-)
> 
> fpc streamio
> 

Results in church related links, LOL.


Better "freepascal streamio".

<https://www.freepascal.org/docs-html/fcl/streamio/index.html>

«The StreamIO unit implements a call to reroute the input or output of a
text file to a descendents of TStream.»


Sorry, I fail to see how I can use this with writeln to write to *both*
output and file at the same time. Maybe I miss something :-?

-- 
Cheers / Saludos,

Carlos E. R.
(from 42.3 x86_64 "Malachite" at Telcontar)



signature.asc
Description: OpenPGP digital signature
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Cloning standard output to text file

2018-05-04 Thread Carlos E. R. via Lazarus
On 2018-05-04 18:46, Reimar Grabowski via Lazarus wrote:
> On Fri, 4 May 2018 13:34:54 +0200
> "Carlos E. R. via Lazarus" <lazarus@lists.lazarus-ide.org> wrote:
> 
>> Yes, of course, that's what I'm doing now, but I wanted to do it
>> internally, control the file name, perhaps rotate it, etc :-)
> Perhaps you should use a logger.
> There are surely some FPC ones out there that can do all this for you.
> A fast google search brings up http://wiki.freepascal.org/Log4Delphi which is 
> based on Log4J (which does all that).

Well, I send to syslog the important things :-)

In this phase I use many writeln as debug help, and using a pipe and a
tee does the job fine.

The idea here:
<http://lists.freepascal.org/fpc-pascal/2010-July/026163.html> redirects
all stdout to a file, but I'm thinking that it is basically the same as
replacing all writeln found with writeln(F, ...), achieving the same
thing perhaps simpler. Well, except that commenting out a the call to
"redirect" disables it.

The basic trick it does is:

var
  f : TextFile;
  s: TDebugStream;

and a procedure to redirect the output:


procedure redirect;
begin
 s := TDebugStream.Create();
 AssignStream(f, s);
 Rewrite(f);
 output := f;
end;


wich replaces stdout (output) with f. The role of tTDebugStream I don't
get. It is created thus:



Type
  TDebugStream = class(TStream)
function Write(const Buffer; Count : Longint) : Longint; override;
  end;

implementation

function TDebugStream.Write(const Buffer; Count : Longint) : Longint;
var
  msg : ansistring;

begin
  result := count;
  SetLength(msg, count);
  move(buffer, PChar(msg)[0], count);
  OutputDebugString(PChar(TrimRight(msg)));
end;



I also miss where the file name is assigned.


But anyway, what I wanted is to write both to the screen and to a file,
so this is not sufficient.


Further in the thread they say that this would do - this is the classic
method I had forgotten:


var
   oldoutput, f: TextFile;
begin
   AssignFile(f, 'somefile');
   Rewrite(f);
   oldoutput := Output;
   Output := f;
   Writeln('Hello World'); // this is send to Output
   Output := oldoutput;
   CloseFile(f);
end.

At the start of the thread there is a suggestion to "implementing your
own textfile driver", but the link is dead.



-- 
Cheers / Saludos,

Carlos E. R.
(from 42.3 x86_64 "Malachite" at Telcontar)



signature.asc
Description: OpenPGP digital signature
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Cloning standard output to text file

2018-05-04 Thread Carlos E. R. via Lazarus
On 2018-05-04 13:30, Bart via Lazarus wrote:
> On Fri, May 4, 2018 at 12:51 PM, Carlos E. R. via Lazarus
> <lazarus@lists.lazarus-ide.org> wrote:
> 
>> I want to do a series of "writeln(...)" and have the output go
>> simultaneously to the console and to a text file of my choice. I have
>> the vague idea that this was done writing a text file handler :-?
> 
> I once wrote a simple utility (myutil) that read from stdin, echoed to
> stdout and echoed to a logfile.
> I then used a pipe from the commandline to achieve what I wanted.
> E.g.:
> 
> myprog | mytuil path/to/log
> 
> Or something similar to that.

Yes, of course, that's what I'm doing now, but I wanted to do it
internally, control the file name, perhaps rotate it, etc :-)


Actually:

myprog | tee mytuil path/to/log



It has the effect that text to screen is written in chunks, may stop at
the middle of a line. So at the end each cycle, I issue a "flush(output);"

-- 
Cheers / Saludos,

Carlos E. R.
(from 42.3 x86_64 "Malachite" at Telcontar)



signature.asc
Description: OpenPGP digital signature
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Cloning standard output to text file

2018-05-04 Thread Carlos E. R. via Lazarus
On 2018-05-04 12:58, Mattias Gaertner via Lazarus wrote:
> On Fri, 4 May 2018 12:51:38 +0200
> "Carlos E. R. via Lazarus" <lazarus@lists.lazarus-ide.org> wrote:
> 
>> [...]
>> I want to do a series of "writeln(...)" and have the output go
>> simultaneously to the console and to a text file of my choice. I have
>> the vague idea that this was done writing a text file handler :-?
>> [...]
>> If you know of a google search string to locate these ideas, just tell
>> me ;-)
> 
> fpc redirect stdout

Thank you!  :-)

Found it. At least for redirection, the output is sent to a file.

<http://lists.freepascal.org/fpc-pascal/2010-July/026163.html>

Now I have to figure out how to write both to file and screen :-)

More ideas to investigate here:

<http://fpc-devel.freepascal.narkive.com/KZnUZaMJ/stdout-capture-for-fpc-rtl>

-- 
Cheers / Saludos,

Carlos E. R.
(from 42.3 x86_64 "Malachite" at Telcontar)



signature.asc
Description: OpenPGP digital signature
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Cloning standard output to text file

2018-05-04 Thread Carlos E. R. via Lazarus
Hi,

I know I did this decades ago with Turbo Pascal, but I can't remember
how, and my google foo fails me.

I want to do a series of "writeln(...)" and have the output go
simultaneously to the console and to a text file of my choice. I have
the vague idea that this was done writing a text file handler :-?

I can of course do two writeln calls for each current call, but it is a
nuisance.

I can not use a mywriteln wrapper that would do the two calls, because I
do not know how to create a procedure that takes a variant number of
parameters, as "writeln()" does...

Ideas?

If you know of a google search string to locate these ideas, just tell
me ;-)

-- 
Cheers / Saludos,

Carlos E. R.
(from 42.3 x86_64 "Malachite" at Telcontar)



signature.asc
Description: OpenPGP digital signature
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] About a warning of unused parameter.

2018-05-02 Thread Carlos E. R. via Lazarus
On 2018-05-02 08:04, Mattias Gaertner via Lazarus wrote:
> On Wed, 2 May 2018 02:19:05 +0200 "Carlos E. R. via Lazarus" <> wrote:
> 
>> [...]
>> function TPINGSend.Checksum6(Value: AnsiString): Word;
>> begin
>>   Result := 0;
>> end;
> 
> You can:
> a) add a dummy statement: if Value='' then ;
> b) add an IDE directive: right click on this message in the Lazarus
> Messages window, Hide message by inserting IDE directive
> 
> Mattias> 
>> I see on the contextual menu of the warning that I can silence that
>> warning type on a file (all warnings of that type in that file, not just
>> the ones I know about):
>>
>> {$WARN 5024 off : Parameter "$1" not used}
>>
>> Lazarus writes "on"; tried both. Neither work, the warning still appears.
> 
> It should be "off". I fixed that in trunk.

Then I'll wait till that update reaches me :-)

I do not want to kill the warning for all files, only those I have reviewed.

-- 
Cheers / Saludos,

Carlos E. R.
(from 42.3 x86_64 "Malachite" at Telcontar)



signature.asc
Description: OpenPGP digital signature
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] About a warning of unused parameter.

2018-05-01 Thread Carlos E. R. via Lazarus
Hi,

I'm experimenting with doing "ping host" on Lazarus using the Synapse
library (http://synapse.ararat.cz/doku.php/download). The code on my
side is very simple, I just have to "use pingsend", then basically
ping.ping('some host');

I have a little nuisance: building the included library produces a ton
of warnings. This thing was last updated on 2012 (release no. 40).

For instance, this one:

pingsend.pas(137,24) Hint: Parameter "Value" not used


The code is different on Windows or Linux, by using {$IFDEF MSWINDOWS}
clauses. On Linux, the effective code is;

function TPINGSend.Checksum6(Value: AnsiString): Word;
begin
  Result := 0;
end;

So the warning is true, but I don't see what I can do about it without
changing the function definition (I could just not call the function in
Linux). I can do:

  Result := 0;
  Value:='';

but that just changes the warning to:

pingsend.pas(137,24) Hint: Value parameter "Value" is assigned but never
used

which is of course true.



So I wonder if there is something to silence that particular warning
alone. Say, yes, I know about that one, shut up.


I see on the contextual menu of the warning that I can silence that
warning type on a file (all warnings of that type in that file, not just
the ones I know about):

{$WARN 5024 off : Parameter "$1" not used}

Lazarus writes "on"; tried both. Neither work, the warning still appears.

Ideas?

-- 
Cheers / Saludos,

Carlos E. R.
(from 42.3 x86_64 "Malachite" at Telcontar)



signature.asc
Description: OpenPGP digital signature
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Unknown error codes.

2018-04-29 Thread Carlos E. R. via Lazarus
On 2018-04-29 22:07, Donald Ziesig via Lazarus wrote:
> On 04/29/2018 03:00 PM, Carlos E. R. via Lazarus wrote:
>> Hi,
>>
>> The other day I got this error in a program (on Linux):
>>
>> cer@Telcontar:~/bin/lazarus/mios> ./crc32test ./crc32test
>> An unhandled exception occurred at $00400951:
>> EInOutError: Unknown Run-Time error : 026
>>   $00400951 line 26 of crc32test.lpr
>>   $00400A5C line 42 of crc32test.lpr
>>
>> crc32 = cer@Telcontar:~/bin/lazarus/mios>
>>
>>
>> Notice the "Unknown" there. And indeed, error 26 is not listed here:
>>
>> <https://www.freepascal.org/docs-html/rtl/system/ioresult.html>
>>
>>
>> A friend pointed me to this file:
>>
>> /usr/include/asm-generic/errno-base.h

...

>> Runtime error 216 at $00400BD5
>>   $00400BD5  INCLOCKED
>>   $00400216  DISPLAY,  line 23 of project1.lpr
>>   $00400360  main,  line 32 of project1.lpr
>>   $0042BE00  SYSENTRY,  line 129 of system.pp
>>   $004001D2

...

> 216 is a General Protection Fault.
> 
> for other errors see:  https://freepascal.org/docs-html/user/userap4.html

It does not list the error 26 I got.

It is possible that there are different numbers on different operating
systems? That list seems to be related to Windows, but the link does not
say.

-- 
Cheers / Saludos,

Carlos E. R.
(from 42.3 x86_64 "Malachite" at Telcontar)



signature.asc
Description: OpenPGP digital signature
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Unknown error codes.

2018-04-29 Thread Carlos E. R. via Lazarus
Hi,

The other day I got this error in a program (on Linux):

cer@Telcontar:~/bin/lazarus/mios> ./crc32test ./crc32test
An unhandled exception occurred at $00400951:
EInOutError: Unknown Run-Time error : 026
  $00400951 line 26 of crc32test.lpr
  $00400A5C line 42 of crc32test.lpr

crc32 = cer@Telcontar:~/bin/lazarus/mios>


Notice the "Unknown" there. And indeed, error 26 is not listed here:




A friend pointed me to this file:

/usr/include/asm-generic/errno-base.h

and there it is indeed listed:

#define ETXTBSY 26  /* Text file busy */

The error number does match the situation: the IDE has hold of that file
for debugging. Interesting.


But the problem is, why is that error not listed, unknown?

Today a poster wrote about this other error (subject: [Lazarus] Runtime
error: INCLOCKED):

Runtime error 216 at $00400BD5
  $00400BD5  INCLOCKED
  $00400216  DISPLAY,  line 23 of project1.lpr
  $00400360  main,  line 32 of project1.lpr
  $0042BE00  SYSENTRY,  line 129 of system.pp
  $004001D2


which is not listed. I do not know if he is running Linux or Windows, so
I have no idea either what the error is in his case.

Do we know of more places that list those error numbers? Can we compose
a full list?

By the way, C has a function: "strerror(26)" which returns the text
message for the error. I don't know if we have.



-- 
Cheers / Saludos,

Carlos E. R.
(from 42.3 x86_64 "Malachite" at Telcontar)



signature.asc
Description: OpenPGP digital signature
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Beep?

2018-03-29 Thread Carlos E. R. via Lazarus

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1



On Monday, 2018-03-26 at 06:09 +0200, Carlos E. R. via Lazarus wrote:


On 2018-03-26 04:02, Donald Ziesig via Lazarus wrote:

Hi Everyone!

I am using Lazarus 1.8 on Linux Mint.  I would like to use the
Windows.Beep( Freq, Duration) function, or (if not available)
SysUtils.Beep subprograms.


AFAIK, you can not call Windows functions in Linux.


Further, my understanding is that the loudspeaker is associated to the 
terminal in Linux. You can not thus beep from a daemon, something that 
would be useful. We apparently do not get access to program the chip as in 
MsDOS, nor freq,duration.



Here I post an attempt I did back on 2005. It doesn't compile, and this 
moment I can't check why. Nor, of course, do I remember what I was trying.


program beeper;

uses linux;

var
Saved43, Saved61: byte;
LoadClock: word;
frequency: word;
duration:  real;
RequestedDuration, RemainingDuration: timespec;

hh,mm,ss, msec, usec: word;
begin
(*
if paramcount <> 2 then begin
writeln('Produces a beep of the indicated frequency and 
duration.');

writeln('Usage: beeper frequency duration');
halt(1);
end;


frequency:= round(ParamStr(1));
duration:= ParamStr(2);
*)

frequency:= 500;
duration:=  1.2;


RequestedDuration.tv_sec:=  trunc(duration);
RequestedDuration.tv_nsec:= trunc(frac(duration)*1e9);

{ioperm(from, num, value)}
writeln($61, '   ', $42);
writeln(ioperm($61, 1, 1), ' ', ioperm($42, 2, 1));

{timer prepare}
ReadPort($43, Saved43);
writeln('43h', ' ', Saved43);
writeport($43, byte($B6));  {Channel 2, LSB/MSB}

LoadClock:= 1193180 div frequency;
writeport($42, Lo(LoadClock));
writeport($42, Hi(LoadClock));

ReadPort($61, Saved61);
writeln('61h', ' ', Saved61);
writeport($61, byte(Saved61 or $3));{Speaker on}


{Select(0, nil, nil, nil, 1000);}
gettime(hh,mm,ss, msec, usec);
writeln(hh,':', mm, ':', ss, '.', msec, ' ', usec);
nanosleep(RequestedDuration, RemainingDuration);
gettime(hh,mm,ss, msec, usec);
writeln(hh,':', mm, ':', ss, '.', msec, ' ', usec);

writeport($61, Saved61);{Speaker off}

end.


I also have copies of some c code I got from fidonet posts that I can look 
at another day, in assembler. I don't remember if they worked, probably 
not.



- -- 
Cheers,

   Carlos E. R.
   (from openSUSE 42.3 x86_64 "Malachite" at Telcontar)

-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iEYEARECAAYFAlq8vCgACgkQtTMYHG2NR9W0MQCfW3PJfWFopnrWMV9V+bCcA1ZQ
2goAn3C6b2V2kwsunTiqB5o1vIQIaF8H
=v6dw
-END PGP SIGNATURE--- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Beep?

2018-03-25 Thread Carlos E. R. via Lazarus
On 2018-03-26 04:02, Donald Ziesig via Lazarus wrote:
> Hi Everyone!
> 
> I am using Lazarus 1.8 on Linux Mint.  I would like to use the
> Windows.Beep( Freq, Duration) function, or (if not available)
> SysUtils.Beep subprograms.

AFAIK, you can not call Windows functions in Linux.

-- 
Cheers / Saludos,

Carlos E. R.
(from 42.3 x86_64 "Malachite" at Telcontar)



signature.asc
Description: OpenPGP digital signature
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Translating a small C program to pascal (on lazarus)

2018-02-26 Thread Carlos E. R. via Lazarus
On 2018-02-26 18:56, Giuliano Colla via Lazarus wrote:
> Il 26/02/2018 03:51, Carlos E. R. via Lazarus ha scritto:
>> Ah!  I didn't realize it could translate the declarations on a .c file,
>> I thought it was only for .h files.
>>
>> I just had a quick test, but... I'll have to read on it, the quick test
>> crashes:
> 
> Well actually it is only for .h files, but as .h files are just
> declaration, it can handle a good part of the job.
> 
> Most likely it crashes because it doesn't know how to handle the code
> after the declarations.

That can't explain a "EAccessViolation: Access violation". It could be a
syntax error, yes, but never an exception. And it happens before the
code part.

<https://www.freepascal.org/docs-html/rtl/sysutils/eaccessviolation.html>

Description

EAccessViolation is raised when the OS reports an Access Violation, i.e.
when invalid memory is accessed.


> What I'd do in your place would be to create a sort of .h file, by
> cutting away from the original source everything except the
> declarations, and translate it.

Yes, I'll do that.


> Then translating the code, when you have all declarations in place
> becomes much easier, the bulk of it being sort of:
> 
> replace all "{" with "begin"
> 
> replace all "}" with "end;"
> 
> replace all "0x" with "$"
> 
> and so on.

Actually, the OpenC2Pas program did a lot of that :-)

Hopefully, one program translates most of the declarations, and another
a good part of the code :-)

-- 
Cheers / Saludos,

Carlos E. R.

  (from 42.3 x86_64 "Malachite" (Minas Tirith))



signature.asc
Description: OpenPGP digital signature
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Translating a small C program to pascal (on lazarus)

2018-02-25 Thread Carlos E. R. via Lazarus
On 2018-02-26 01:11, Giuliano Colla via Lazarus wrote:
> Il 25/02/2018 20:52, Carlos E. R. via Lazarus ha scritto:
> 
>> I want to translate a little Linux C program (600 lines) to pascal (so
>> that I can then add my parts in comfort). I failed to find a good
>> automated tool in Linux. I had a look here: 
> 
> Did you consider h2pas (which comes with fpc/Lazarus)?
> It's only intended to translate C headers to Pascal, but it makes a good
> job on this.
> 
> You can only use it to translate declarations, but once declarations are
> in Pascal, converting the code becomes much easier.

Ah!  I didn't realize it could translate the declarations on a .c file,
I thought it was only for .h files.

I just had a quick test, but... I'll have to read on it, the quick test
crashes:

cer@Telcontar:~/bin/lazarus/mios/egctl> h2pas egctl.c
at line 49 error : syntax error
at line 82 error : syntax error
An unhandled exception occurred at $004089F2:
EAccessViolation: Access violation
  $004089F2

cer@Telcontar:~/bin/lazarus/mios/egctl>

It did some translation, though:

-rw-r--r-- 1 cer users   0 Feb 26 03:36 ext2.tmp
-rw-r--r-- 1 cer users   0 Feb 26 03:36 ext.tmp
-rw-r--r-- 1 cer users1579 Feb 26 03:36 ext3.tmp


The last file contains a translation till it crashed:


{$include }
...
  const
TASK_LEN = 4;
STATCRYP_LEN = 4;
CTRLCRYP_LEN = 4;
KEY_LEN = 8;
...
SOCKET_COUNT = 4;
(* error
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
in define line 49 *)


type
  Protocol = (EG_PROTO_V20,EG_PROTO_V21,EG_PROTO_WLAN
);

  Action = (ACTION_ON,ACTION_OFF,ACTION_TOGGLE,ACTION_LEFT,
ACTION_INVALID);

  Actions = record
  socket : array[0..(SOCKET_COUNT)-1] of Action;
end;

  Key = record
  octets : array[0..(KEY_LEN)-1] of uint8_t;
end;
{ since the protocol is little-endian, low word comes first  }


and here it crashes.

-- 
Cheers / Saludos,

Carlos E. R.
(from 42.2 x86_64 "Malachite" at Telcontar)



signature.asc
Description: OpenPGP digital signature
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Translating a small C program to pascal (on lazarus)

2018-02-25 Thread Carlos E. R. via Lazarus
On 2018-02-25 21:26, Mark Morgan Lloyd via Lazarus wrote:
> On 25/02/18 20:00, Carlos E. R. via Lazarus wrote:


>> Hi,
>> I want to translate a little Linux C program (600 lines) to pascal (so
>> that I can then add my parts in comfort). I failed to find a good
>> automated tool in Linux. I had a look here:
>> <http://wiki.freepascal.org/C_to_Pascal>
>> I used "OpenC2Pas" but there remains quite a lot to translate.
> 
> etc. Presumably the original looks something like
> https://github.com/unterwulf/egctl/blob/master/egctl.c

Absolutely! :-)

How did you find out that fast?

> I've just been through a comparable exercise writing a utility to
> program a Logitech G600 gamer's mouse, and my suggestion would be to use
> Wireshark etc. to get an understanding of the messages going over the
> network then to transcribe the bits of the program you need into Pascal
> manually.

I don't think I have the skill set for that. I guess that the author of
that code, Vitaly Sinilin, had the Windows SDK for the device (a power
strip controllable and programmable via Ethernet, LAN or WAN) and did a
translation to Linux of the Windows command line tool. The SDK comes
with the CD when purchasing the power strip, but the box I bought on
Amazon had none. Perhaps it can be downloaded for free (I did not look
yet), but anyway, it is for Windows (and probably C).

> Assuming that since you're asking on the Lazarus ML you're putting
> together a GUI to control the device you probably won't want roughly
> half of the original code which is using C-style string operations to
> read a configuration file.

No, I'm not writing a GUI, I'm attempting to write a daemon. :-)

I have a router that hangs randomly, and I can't replace it because it
is ISP supplied with a complex configuration. So the idea is to ping the
router and when it goes silent power cycle it. I have tested the idea, I
can power a socket off from Linux using that utility, and then a
programmed schedule switches it back on on the 00 seconds mark (the
power strip syncs via NTP). The period can be programmed to anything,
but currently it is set to every minute.

So first I have to handle that powering off some seconds before the "00"
mark, then I have to add the ping, wait for router come back alive, log
the event, update the dynamic dns, email me, and go back to watch.

Of course, I could do it all from a bash script, maybe easier. But I
want to have a go at doing it in Pascal first. :-)


The funny thing is, I programmed for a living in C two decades ago, I
was good. It seems I fave forgotten most of it. :-}


I hopped to find people here familiar with C to pas translation. I also
did this type of things long ago... I translated some windows api
headers to pascal back then.

-- 
Cheers / Saludos,

Carlos E. R.
(from 42.2 x86_64 "Malachite" at Telcontar)



signature.asc
Description: OpenPGP digital signature
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Problem accessing the lazarus forums...

2017-12-04 Thread Carlos E. R. via Lazarus

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1



On Sunday, 2017-12-03 at 17:34 -0600, R0b0t1 via Lazarus wrote:

On Sun, Dec 3, 2017 at 5:29 PM, Bo Berglund via Lazarus <> wrote:




Well, I already tried variations of that and came up empty-handed:
~ $ sudo find / -name 'fpc.cfg' -print
~ $

Any other suggestion?
(What about the lazarus forum?)



The package mlocate contains the locate and updatedb commands, and
produces quick results.


And will fail. If "find" failed to find anything, locate also will fail.

- -- 
Cheers,

   Carlos E. R.
   (from openSUSE 42.2 x86_64 "Malachite" at Telcontar)

-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iEYEARECAAYFAlolN6sACgkQtTMYHG2NR9VbdQCeJA2s6pmWNkKN7ElCeEJql0Ap
swMAmgOgl8yKa9rX0+VDplO7Z050ebL5
=NguN
-END PGP SIGNATURE-
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Who is using Object Pascal in production?

2017-10-30 Thread Carlos E. R. via Lazarus

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1



On Monday, 2017-10-30 at 10:21 +0200, Juha Manninen via Lazarus wrote:

On Mon, Oct 30, 2017 at 8:56 AM, Sven Barth via Lazarus <> wrote:



Yes, it's fpc-pascal and you can find it here:
https://freepascal.org/maillist.var

Alternatively you can use the bug tracker that both projects share at
https://bugs.freepascal.org/


FYI, those bugs should be reported against FPC trunk which already
differs a lot from the release version, due to the slow release cycle.


Oh, but I'm not going to install the trunk version, sorry.

- -- 
Cheers,

   Carlos E. R.
   (from openSUSE 42.2 x86_64 "Malachite" at Telcontar)

-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iEYEARECAAYFAln3G38ACgkQtTMYHG2NR9XQJgCaA6O/iF59T5rLnxpE1nUCx5Nh
WDQAn3FWytCTH7bGk4Fha4VxaNzgBI+2
=GV/H
-END PGP SIGNATURE-
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Who is using Object Pascal in production?

2017-10-29 Thread Carlos E. R. via Lazarus

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1



On Monday, 2017-10-30 at 00:59 +0200, Juha Manninen via Lazarus wrote:

On Mon, Oct 30, 2017 at 12:48 AM, Carlos E. R. via Lazarus <> wrote:

About a year ago or more.
...
/usr/share/fpcsrc/packages/fv/examples/testapp.lpi


Ok, this was about FPC examples. I assumed Lazarus examples because
this is Lazarus list.
A year ago there may have been more broken Lazarus examples, too, but
most of them are now checked.

It would make sense to report the FPC example issue.


I don't really differentiate between the IDE and the compiler, sorry. I 
mean, I know they are different projects, but still... both have to work 
together. I don't remember what examples I have tried, I just went for the 
first one I could find with "open project". An .lpi file is a Lazarus 
project file, right?


And where does one report fpc issues such as that one, is it another mail 
list?


- -- 
Cheers,

   Carlos E. R.
   (from openSUSE 42.2 x86_64 "Malachite" at Telcontar)

-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iEYEARECAAYFAln2YKAACgkQtTMYHG2NR9Wr9wCcD0yAceZJxpFEQkpU6ddjIf3O
0YQAn3l6jnoVFCc0kvEuo563RNcbBj3U
=jiX2
-END PGP SIGNATURE-
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Who is using Object Pascal in production?

2017-10-29 Thread Carlos E. R. via Lazarus

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1



On Sunday, 2017-10-29 at 17:20 +0200, Juha Manninen via Lazarus wrote:

On Sun, Oct 29, 2017 at 5:04 PM, Carlos E. R. via Lazarus <> wrote:

Well, I use Linux :-)


I also use Linux and I have tested them, too.


Of course not all examples fail, and maybe some were corrected since I
tried.


When did you try?


About a year ago or more.




Well, I can try, but I have no idea where/how to report bugs.


You could for example list the broken examples here. That's what I
asked earlier.


Sorry, I didn't see it. In this thread? I don't read all threads.


I doubt you will do it. Clearly this is yet another rant without substance.
First Samuel Herzog pulls a complaint from his hat. Then you repeat it
without testing.


If you are really interested in me testing, I will test.
I know for sure that some samples did not work, but I did not take notes.

Ok, I look now, randomly, at "testapp.lpi". Build fails at:

testapp.pas(38,2) Fatal: Cannot open include file "platform.inc"

sources are old, so I refresh them. [...] I do, but the error remains.

Project is at:

/usr/share/fpcsrc/packages/fv/examples/testapp.lpi

Missing file does exist, at:

/usr/share/doc/packages/fpc/examples/fv/examples/platform.inc
/usr/share/fpcsrc/packages/fv/src/platform.inc


and I copied the tree to my home dir. I have not looked at what may be the 
cause, but doing so may be offtopic for this thread. Maybe the paths are 
broken because the project was copied to HOME. Maybe the project is not 
intended for Linux, I don't know.



- -- 
Cheers,

   Carlos E. R.
   (from openSUSE 42.2 x86_64 "Malachite" at Telcontar)

-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iEYEARECAAYFAln2WrUACgkQtTMYHG2NR9Uo/ACcCTH8dymLRcMEX/W1wz/1k2q1
/Z8Anjp8Vwg8VWE7XcMfTJTBQJiyRXPz
=ErUS
-END PGP SIGNATURE-
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Who is using Object Pascal in production?

2017-10-29 Thread Carlos E. R. via Lazarus

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1



On Sunday, 2017-10-29 at 15:42 +0100, Werner Pamler via Lazarus wrote:

Am 29.10.2017 um 14:01 schrieb Carlos E. R. via Lazarus:


 B) Examples that work out of the box. ( when I choose examples in Lazarus,
 half of them do not work).

 This is sadly true.


Certainly not. I spent the previous hours checking all demos in the examples 
folder under Windows 10, and the vast majority of them is working. The only 
one I could not get around with is the fpdocmanager example with uses two 
units that I have never seen. A few issues with other examples were fixed.


Well, I use Linux :-)

Of course not all examples fail, and maybe some were corrected since I 
tried.


Instead of complaining that examples are not working you should write a 
bugreport, and it will be fixed. It is a damn boring job looking through 
almost 100 demos...


Well, I can try, but I have no idea where/how to report bugs.

- -- 
Cheers,

   Carlos E. R.
   (from openSUSE Linux 42.2 x86_64 "Malachite" at Telcontar)

-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iEYEARECAAYFAln17fcACgkQtTMYHG2NR9XG7gCfcossWFnQD+h33Qur7Nlx+pWu
4VgAn0v5ujiTeFxI6SOuMllXrMPNXF5c
=uKB5
-END PGP SIGNATURE-
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Who is using Object Pascal in production?

2017-10-29 Thread Carlos E. R. via Lazarus

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1



On Sunday, 2017-10-29 at 10:23 -, Samuel Herzog via Lazarus wrote:


To attract more/new users to Object-Pascal "universe" the following things 
would help:  (applies for both Delphi and Lazarus)

A) a way to give a whole project from one developer to another developer. (no 
fiddeling around with missing
packages/components/paths/environment-path).
    e.g. a Menu-Option "Export-Project" which creates a bundle with all 
necessary files)


Interesting.


B) Examples that work out of the box. ( when I choose examples in Lazarus, half 
of them do not work).


This is sadly true.

I have come back to Pascal (I previously used Borland Pascal a lot, but 
not Delphi), I love Lazarus, and I needed to see current day examples of 
things, but some of them fail to build or crash instantly. I don't have a 
list.


I also find very confusing that libraries for similar purposes exist and 
it is not easy to choose one. I could not see documentation on what a 
library to use and which not to use.



C) Beginner Videos.


I don't like videos very much, dunno. I prefer docs with photos. After 
all, code is text...


- -- 
Cheers,

   Carlos E. R.
   (from openSUSE 42.2 x86_64 "Malachite" at Telcontar)

-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iEYEARECAAYFAln10SQACgkQtTMYHG2NR9VbWgCbBDZQNdbxpsyPPvGCrjvMZcc2
trYAn0INjnu3NNqseZUfZcZuNsOXk3Fa
=Jg1T
-END PGP SIGNATURE--- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] SPAM - Postfix master

2017-05-19 Thread Carlos E. R. via Lazarus
On 2017-05-19 11:49, Marc Weustink via Lazarus wrote:
> José Mejuto via Lazarus wrote:
>> Hello,
>>
>> Can Postfix master ban 14.169.188.113 ? All "Gabor Boros" (I know he is
>> not responsible) spam comes from that mail server (DNS name does not
>> match IP, only reverse resolution) and it looks like a Fiber/DSL user in
>> Vietnam.
>>
>> The IP is listed in at least 15 spam blacklists.
> 
> Yup... that's why my spamassassin marked it as spam.
> I've enabled spamassassin on the lazarus server for all lists.
> Positives are for now put on hold (to check for false positives). In the
> future messages will be discarded.

Be careful, spamassassin has false positives now and then. If you are
going to do automatic discards, do it for a score of 10 or more.

I don't ever do automatic discards.

-- 
Cheers / Saludos,

Carlos E. R.

  (from 42.2 x86_64 "Malachite" (Minas Tirith))



signature.asc
Description: OpenPGP digital signature
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Annoying lazarus mailing list behaviour

2017-05-07 Thread Carlos E. R. via Lazarus
On 2017-05-07 12:18, Michael Van Canneyt via Lazarus wrote:
> On Sun, 7 May 2017, Sven Barth via Lazarus wrote:


>> Addendum: what E-Mail client do you use? Both Android's GMail App and
>> Thunderbird (with Reply to List) handle it correctly.
> 
> Pine.

With Pine I get:

To: somebody via lazarus 

Hitting Reply, not to all.

-- 
Cheers / Saludos,

Carlos E. R.
(from 42.2 x86_64 "Malachite" at Telcontar)



signature.asc
Description: OpenPGP digital signature
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Annoying lazarus mailing list behaviour

2017-05-07 Thread Carlos E. R. via Lazarus
On 2017-05-07 12:15, Sven Barth via Lazarus wrote:
> Am 07.05.2017 12:11 schrieb "Michael Van Canneyt via Lazarus"
> >:
>>
>>
>> Hi,
>>
>> Can we please get rid of the Cc: being added to the mails sent through the 
>> lazarus
>> mailing list ?

...

It doesn't bother me much, I can filter it out (with procmail).
In fact, as the "from" is changed, I see the CC as a way to be able to
send a personal mail if needed.


>> This is VERY annoying.
>>
>> (not the mails from Mattias, but the mailing list behaviour ;) )
> 
> If you go back some months it was revealed that this is now necessary
> due to increased security in Gmail and Co. Otherwise mails from the list
> would be bounced.

I subscribe to several mail lists, and I have not seen any problem with
gmail. :-?

-- 
Cheers / Saludos,

Carlos E. R.
(from 42.2 x86_64 "Malachite" at Telcontar)



signature.asc
Description: OpenPGP digital signature
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] How can I write to arbitrary position on device

2017-04-13 Thread Carlos E. R. via Lazarus
On 2017-04-13 09:15, Mark Morgan Lloyd via Lazarus wrote:
> On 12/04/17 21:30, Carlos E. R. via Lazarus wrote:
>> Hi,
>> I'm new on this list, so if I should post this to a different place,
>> just tell me.
>> I want to find a function that I can use on Linux to write a memory
>> block to an arbitrary position on a device, say, /dev/sda or /dev/sda5 .
>> I can do that on an opened file with seek() and write(), but apparently
>> only on files. I need accessing the raw disk device. So currently I call
>> 'dd' instead.
>> I also had problems with blockread/write: it failed reading more than
>> one megabyte.
> 
> That's interesting, I need to look at some medium testing stuff over the
> next few days and was assuming I'd need to check the dd sources. Are you
> running as root to get direct access to the device?

Thanks for responding. :-)

I had and idea, tried it, and it worked. I simply assign:

   assign(Fout, '/dev/sdc');
   Reset (Fout);

The file can be a file of bytes, or in my case, a typed file (of an
array). Works perfectly, I can write chunks at 180 MiB/s.  :-)

For writing to some position, I assume I could use Seek(). I haven't tried.

Yes, of course, even for testing you need being root to run the code. So
the IDE runs as my user, the code in another terminal as root. Scary,
because I write directly to /dev/sdc (I'm filling the disk with random
data fast, prior to encrypting it. 7 hours for a 4TB disk).

Perhaps I could instead chmod or chown the device [...] Yes, it works,
better! It is undone on reboot, but that doesn't matter.

-- 
Cheers / Saludos,

Carlos E. R.
(from 42.2 x86_64 "Malachite" at Telcontar)



signature.asc
Description: OpenPGP digital signature
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] How can I write to arbitrary position on device

2017-04-12 Thread Carlos E. R. via Lazarus


Hi,

I'm new on this list, so if I should post this to a different place, 
just tell me.


I want to find a function that I can use on Linux to write a memory 
block to an arbitrary position on a device, say, /dev/sda or /dev/sda5 .


I can do that on an opened file with seek() and write(), but apparently 
only on files. I need accessing the raw disk device. So currently I call 
'dd' instead.


I also had problems with blockread/write: it failed reading more than 
one megabyte.


--
Cheers

Carlos E. R.
(from 42.2 x86_64 "Malachite" at Telcontar)


--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus