Re: [fpc-pascal] Connecting to a MySQL Server

2017-10-05 Thread Michael Van Canneyt



On Thu, 5 Oct 2017, Terry A. Haimann wrote:


What library do I need to install on Raspian (Raspberry Pi) to allow
Free Pascal to attach to a Mysql Server.  Note the MySQL Server is
running on a i5 and is actully  MariaDB 5.5.47

An unhandled exception occurred at $000E7398:
EInOutError: Can not load default MySQL library ("libmysqlclient.so.18"
or "libmysqlclient.so"). Check your installation.
 $000E7398
 $0009BC0C
 $0008CDE8

Thanks in advance,


The message says it all: You need libmysqlclient.so.18.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Connecting to a MySQL Server

2017-10-05 Thread Terry A. Haimann
What library do I need to install on Raspian (Raspberry Pi) to allow
Free Pascal to attach to a Mysql Server.  Note the MySQL Server is
running on a i5 and is actully  MariaDB 5.5.47

An unhandled exception occurred at $000E7398:
EInOutError: Can not load default MySQL library ("libmysqlclient.so.18"
or "libmysqlclient.so"). Check your installation.
  $000E7398
  $0009BC0C
  $0008CDE8

Thanks in advance,

Terry

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Managed properties idea

2017-10-05 Thread Marcos Douglas B. Santos
On Thu, Oct 5, 2017 at 5:55 AM, Ryan Joseph  wrote:
>
>> On Oct 5, 2017, at 12:28 PM, Sven Barth via fpc-pascal 
>>  wrote:
>>
>> The way to go in Object Pascal are reference counted interfaces (aka 
>> COM-style interfaces). After all one should program against an interface 
>> anyway and that reference counted interfaces are automatically handled by 
>> the compiler is an added bonus.
>>
>>
>
> example? I’ve been doing retain management manually and honestly I prefer 
> that for some cases where I want more control so I still like that syntax 
> option.
>

As Sven told you, just use COM Interfaces.
Look this explanation ->
http://castle-engine.io/modern_pascal_introduction.html#_corba_and_com_types_of_interfaces
but don't pay attention when to author says "Ugly (COM) interfaces"
because it is not. :)

Really, it is not.

Best regards,
Marcos Douglas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] For ..in GetEnumerator Allocation

2017-10-05 Thread Martok
Am 04.10.2017 um 11:26 schrieb Michael Van Canneyt:
> As an alternative you can create an object enumeator. 
> It's simply allocated on the stack, and you can reset it in the enumerator
> operator.
That is by far the easiest solution (records need $modeswitch advancedrecords,
but are otherwise equivalent).

As an example, here's how I iterate over at TNodeSet returned by fcl-xml's XPath
engine: 

The object is allocated on the stack and simply cleared/reset every time the
operator is executed.

-- 
Martok
Ceterum censeo b32079 esse sanandam.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] how to get a list of all thread id

2017-10-05 Thread Dennis
In my multi thread programs (I use multiple threads in my program and 
the windows dll that I used also used multiple threads), from time to 
time, there are some problems (e.g some exceptions are raised) which 
caused my program to free after the Application.Run.


The freezing seem to occur even after the finalization of units.

From the task manager, I can see that there are 2 running threads in my 
program (down from a dozen when the program was running ).


Using the gdb does not help me pin point which thread is running wild 
causing the freezing.


I am wonder if I can list out all running thread ids after 
Application.Run, I might find out what those 2 threads are.


Can I do that in windows 32-bit?
Dennis
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Finding long file names

2017-10-05 Thread Sven Barth via fpc-pascal
Am 05.10.2017 01:49 schrieb "James Richters" :
>
> I'm trying to use findfirst()/findnext to obtain a list of files.  Here's
my code:
> Searchfile:=Tap_Drive+Tap_Path+'\'+Tap_SubDirectory+'\*.TAP';
> If FindFirst(Searchfile, FAAnyfile-FAHidden, FileDirInfo)=0 then
> ..
>
> It finds most files, even ones with really long file names, however it
can't find files with periods in the file name,
> So it will find:
> This is a TEST.Tap
>
> But it will not find:
> This.is.a.TEST.tap
>
> If I change my search string to:
> Searchfile:=Tap_Drive+Tap_Path+'\'+Tap_SubDirectory+'\*.*';
>
> Then it DOES find the files with more than one period in them... along
with everything else.
>
> I could filter them out myself I suppose, but that seems to defeat the
way findfirst is supposed to work.
>
> Any ideas how to make this work?  Is there a better method to use than
findfirst() ?
>
> I notice that if I use Extractfileext() with This.is.a.TEST.tap it
correctly returns '.tap' as the extension.  Maybe findfirst is an obsolete
way of listing the files?Or maybe it just never got fixed to handle
valid files with more than one period?
>
> Any thoughts on this?

I can't reproduce it here. Would you please provide a self contained, small
example plus information about the OS, filesystem and compiler as well as a
list of filenames to test with?

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Managed properties idea

2017-10-05 Thread Ryan Joseph

> On Oct 5, 2017, at 12:28 PM, Sven Barth via fpc-pascal 
>  wrote:
> 
> The way to go in Object Pascal are reference counted interfaces (aka 
> COM-style interfaces). After all one should program against an interface 
> anyway and that reference counted interfaces are automatically handled by the 
> compiler is an added bonus.
> 
> 

example? I’ve been doing retain management manually and honestly I prefer that 
for some cases where I want more control so I still like that syntax option.

Regards,
Ryan Joseph

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Finding long file names

2017-10-05 Thread Michael Van Canneyt



On Wed, 4 Oct 2017, James Richters wrote:


I'm trying to use findfirst()/findnext to obtain a list of files.  Here's my 
code:
Searchfile:=Tap_Drive+Tap_Path+'\'+Tap_SubDirectory+'\*.TAP';
If FindFirst(Searchfile, FAAnyfile-FAHidden, FileDirInfo)=0 then
..

It finds most files, even ones with really long file names, however it can't find files with periods in the file name, 
So it will find:

This is a TEST.Tap

But it will not find:
This.is.a.TEST.tap

If I change my search string to:
Searchfile:=Tap_Drive+Tap_Path+'\'+Tap_SubDirectory+'\*.*';

Then it DOES find the files with more than one period in them... along with 
everything else.

I could filter them out myself I suppose, but that seems to defeat the way 
findfirst is supposed to work.

Any ideas how to make this work?  Is there a better method to use than 
findfirst() ?

I notice that if I use Extractfileext() with This.is.a.TEST.tap it correctly 
returns '.tap' as the extension.  Maybe findfirst is an obsolete way of listing 
the files?Or maybe it just never got fixed to handle valid files with more 
than one period?



Findfirst is definitely the way.

If this is on windows, then you've probably found a bug in findfirst/findnext.
Strange that this would go unnoticed for so long.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal