Re: [Lazarus] Tprogressbar and positional info as ptrint.

2012-12-06 Thread Donald Ziesig

On 12/06/2012 09:06 AM, Reinier Olislagers wrote:

On 6-12-2012 14:58, Andrew Brunner wrote:

On 12/05/2012 10:28 PM, Hans-Peter Diettrich wrote:

How wide would that row be, at say 120 dpi? BG



This is not relevant to the issue at hand.  As I stated before, the
progressbar component of the host operating system scales the
Min/Max/Position values and converts it to the client area of the
aggregate value.

So basically, with the Progressbar on 64bit systems the current progress
bar won't accept values except longint.  This is a flaw. This must be a
64bit position.  Otherwise this Lazarus component is relegated to the
least common denominator of 32bit oses.but I

If I understand correctly what you're saying and *if* the OS requires a
64 bit number, then the Lazarus LCL code must be changed to scale the 32
bit integers given to it by the code/LFM streamed properties to 64 bit
integers.

This will maintain compatibility between projects. You may not care
about having your projects compile on multiple platforms without (too
many) code changes, but I and others do.


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


I just got into this thread,  but I have been using Delphi since Version 
1 (and Turbo Pascal back to Version 1 before that). Imo the Min, Max and 
Pos parameters should all be set to the largest integer data type of the 
underlying OS.  If this is done, the scaling issue should be taken care 
of automatically.  There may be a latent flaw due to streaming of these 
parameters, however.


Don Ziesig

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


[Lazarus] Code Completion Templates

2013-02-05 Thread Donald Ziesig

Hi All!

Could anyone point me at the file(s) containing the templates invoked 
with Ctrl-Shift-C?


Specifically I would like to replace the SetParam code that expands to:

if(AValue=fParam) then exit;
fParam=AValue;

with
  Update(fParam,AValue);  // Keeps track of modifications to the 
underlying object.


Thanks,

Don Ziesig


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


Re: [Lazarus] Code Completion Templates

2013-02-10 Thread Donald Ziesig

On 02/05/2013 02:42 PM, Sven Barth wrote:

On 05.02.2013 18:30, Mattias Gaertner wrote:


Donald Ziesig don...@ziesig.org hat am 5. Februar 2013 um 23:16 
geschrieben:

Hi All!

Could anyone point me at the file(s) containing the templates invoked
with Ctrl-Shift-C?

Specifically I would like to replace the SetParam code that 
expands to:


if(AValue=fParam) then exit;
fParam=AValue;

with
Update(fParam,AValue); // Keeps track of modifications to the
underlying object.


It's hard coded.
See components/codetools/codecompletion.pas around line 6730.

You can create a feature request or a patch to make this configurable.


This has already been reported by me nearly three years ago: 
http://bugs.freepascal.org/view.php?id=15922


Regards,
Sven

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



Hi Again,

I have almost finished a patch that uses an xml file, a new unit and 
mods to codecompletion.pas to implement configurable code completion.


I have a few questions remaining:

1) What is the preferred way to specify the name and location of the xml 
file?  I spent several hours trying to access PrimaryConfigPath or 
SecondaryConfigPath from my unit which is in the codetools package.  
Right now I am testing with a hard-coded path/file name.


2) What is the preferred way to submit the patch? (In my previous life, 
before retirement, all I had to do was submit my code to the Quality 
Control unit and wait for their inevitable nasty-grams; the classic of 
which was What is this thing called a 'state machine' you have in your 
code? ;-) ).


3) I have a separate program to parse the xml file and detect any 
possible syntax errors before Lazarus tries to load it.  Where should I 
put that?


Thanks,

Don Ziesig




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


Re: [Lazarus] Code Completion Templates

2013-02-11 Thread Donald Ziesig

On 02/11/2013 03:46 AM, Mattias Gaertner wrote:

On Sun, 10 Feb 2013 20:45:49 -0500
Donald Ziesig don...@ziesig.org wrote:


[...]
I have almost finished a patch that uses an xml file, a new unit and
mods to codecompletion.pas to implement configurable code completion.

I have a few questions remaining:

1) What is the preferred way to specify the name and location of the xml
file?  I spent several hours trying to access PrimaryConfigPath or
SecondaryConfigPath from my unit which is in the codetools package.
Right now I am testing with a hard-coded path/file name.

You can add those options to the existing options.
See ide/codetoolsoptions.pas
  

2) What is the preferred way to submit the patch? (In my previous life,
before retirement, all I had to do was submit my code to the Quality
Control unit and wait for their inevitable nasty-grams; the classic of
which was What is this thing called a 'state machine' you have in your
code? ;-) ).

Attach it to
http://bugs.freepascal.org/view.php?id=15922

  

3) I have a separate program to parse the xml file and detect any
possible syntax errors before Lazarus tries to load it.  Where should I
put that?

What kind of syntax errors? For the xml or for the pascal snippets?

For the xml.  I'm leaving the pascal as an exercise for the student ;-) .

Don

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


Re: [Lazarus] Code Completion Templates

2013-02-11 Thread Donald Ziesig

On 02/11/2013 03:57 PM, Mattias Gaertner wrote:

On Mon, 11 Feb 2013 15:50:47 -0500
Donald Ziesig don...@ziesig.org wrote:


[...]

3) I have a separate program to parse the xml file and detect any
possible syntax errors before Lazarus tries to load it.  Where should I
put that?

What kind of syntax errors? For the xml or for the pascal snippets?

For the xml.  I'm leaving the pascal as an exercise for the student ;-) .

The xml is parsed by the xml reader. It has error messages for syntax
errors. The IDE writes them only to stdout. This was never a problem,
because the xml file is written by the IDE, so there are no syntax
errors.
Hmmm.  In my code, the XML reader detects, and the IDE writes XML errors 
to stdout as you say.  I haven't implemented a GUI to generate the XML. 
(Yet).  Right now, if the author of the XML makes an error, he had 
better be watching stdout while the XML loads so he can catch the 
errors.  I will catch the syntax errors with a handler that puts up a 
message box for now to make them visible to the user.


I want to get the snippet generation fully implemented and tested first 
(it is almost done) before I get fancy with a GUI.


Any suggestions will be appreciated.

Thanks,

Don


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


Re: [Lazarus] Code Completion Templates

2013-02-12 Thread Donald Ziesig

On 02/12/2013 03:36 AM, Mattias Gaertner wrote:

On Mon, 11 Feb 2013 21:43:03 -0500
Donald Ziesig don...@ziesig.org wrote:


[...]
Hmmm.  In my code, the XML reader detects, and the IDE writes XML errors
to stdout as you say.  I haven't implemented a GUI to generate the XML.
(Yet).  Right now, if the author of the XML makes an error, he had
better be watching stdout while the XML loads so he can catch the
errors.  I will catch the syntax errors with a handler that puts up a
message box for now to make them visible to the user.

I want to get the snippet generation fully implemented and tested first
(it is almost done) before I get fancy with a GUI.

Any suggestions will be appreciated.

There are already several frames about options for codetools.
Extend an existing one or add a new one.

Mattias

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


I extended the TCodetoolsClassCompletionOptionsFrame and added the 
template expander data in TCodeToolsOptions.  I can see the data being 
saved and restored appropriately in codetoolsoptions.xml.


I have spent the whole morning trying to find the route I must use to 
get the data in TCodeToolsOptions (which now contains the path to the 
template file) into my TemplateExpander unit (which is in the uses 
clause of codecompletiontool.pas).


The following code from my TemplateExpander unit fails at compilation:

uses
  CodeToolOptions;

because the compiler can't find the file.

What do I need to do to make that unit visible in my code?  It seems to 
have something to do with packages, but after reading the docs, I still 
don't know where to look.


Thanks,

Don Ziesig


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


[Lazarus] Where are the fpc sources for fpc 2.6.2?

2013-02-24 Thread Donald Ziesig

Hi All:

I just got a new laptop and decided to put the latest and greatest 
Lazarus/FPC on it.  I got FPC 2.6.2, installed it and used it to compile 
Lazarus 1.1.  When I run Lazarus it asks for (as an example) 
rtl/linux/system.pp.  I found rtl/linux/system.pp in 
/usr/share/fpcsrc/2.6.0/rtl/linux/system.pp (no sign of 2.6.2/linux) so 
I pointed Lazarus at that path and it warns about the version mismatch.  
Can I use this till I get the updated sources?


I have /usr/lib/fpc/2.6.2 and ~/fpc-2.6.2/lib/fpc/2.6.2 but they both 
only have directories ide, msg and units.


I've been searching for the appropriate sources on the web with no 
success.  I probably am missing something obvious so if anyone can point 
me to them I would sure appreciate it.


Thanks

Don Z.

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


Re: [Lazarus] Where are the fpc sources for fpc 2.6.2?

2013-02-24 Thread Donald Ziesig

On 02/24/2013 05:40 PM, Mattias Gaertner wrote:

On Sun, 24 Feb 2013 17:18:21 -0500
Donald Ziesig don...@ziesig.org wrote:


Hi All:

I just got a new laptop and decided to put the latest and greatest
Lazarus/FPC on it.  I got FPC 2.6.2, installed it and used it to compile
Lazarus 1.1.  When I run Lazarus it asks for (as an example)
rtl/linux/system.pp.  I found rtl/linux/system.pp in
/usr/share/fpcsrc/2.6.0/rtl/linux/system.pp (no sign of 2.6.2/linux) so
I pointed Lazarus at that path

I hope you mean, you pointed Lazarus at /usr/share/fpcsrc/2.6.0,
without the rtl/linux/system.pp.


and it warns about the version mismatch.
Can I use this till I get the updated sources?

Yes, but then the IDE might miss a few sources and/or declarations.

  

I have /usr/lib/fpc/2.6.2 and ~/fpc-2.6.2/lib/fpc/2.6.2 but they both
only have directories ide, msg and units.

I've been searching for the appropriate sources on the web with no
success.  I probably am missing something obvious so if anyone can point
me to them I would sure appreciate it.

See Sven's note.

Mattias

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



Thanks Sven, Reimar and Mattias.

I totally missed that location.:-[   Downloaded, decompressed and copied 
to appropriate paths.  Lazarus 1.1 works without complaining. 8-)


Don

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


[Lazarus] Patch question.

2013-02-26 Thread Donald Ziesig

Hi All!

I have finished the code needed to use xml to specify templates for some 
of the code completion functions.  I was about to create a patch till I 
remembered that the xml file is in ~/.lazarus.  AFAICT this will not go 
into the patch, but should be put into .lazarus on install or build. 
What is the proper way of doing this?


Thanks,

Don Z.

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


Re: [Lazarus] Patch question.

2013-02-26 Thread Donald Ziesig

On 02/26/2013 05:17 PM, Mattias Gaertner wrote:

On Tue, 26 Feb 2013 17:05:59 -0500
Donald Ziesig don...@ziesig.org wrote:


Hi All!

I have finished the code needed to use xml to specify templates for some
of the code completion functions.  I was about to create a patch till I
remembered that the xml file is in ~/.lazarus.  AFAICT this will not go
into the patch, but should be put into .lazarus on install or build.
What is the proper way of doing this?

Check on start if the config file exists. If yes, load it, if not,
create defaults, e.g. copy a file from the lazarus directory.

Mattias

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



Got it!

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


[Lazarus] Visual Form Inheritance from Package.

2013-03-19 Thread Donald Ziesig

Hi All!

I have some base forms that I am using successfully in several 
projects.  I decided to put the common code into a package, including 
the base forms.


Unfortunately, when I try to inherit from them they do not appear in the 
list New | Inherited Project Component, even though the package is 
available to the project (only the main form from the project is available).


Am I trying to take a leap too far?  If so, I will submit a bug report 
and try to create a suitable patch.


I am going to try a simple project with the base forms included in the 
project directly to be sure that I didn't mess something up when I built 
the package.  I don't think I did because the original projects still 
compile and work properly.


Don Ziesig



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


[Lazarus] How to send Email from Lazarus program under Linux x86-64

2013-03-24 Thread Donald Ziesig

Hi All!

I am trying to implement a program that will send emails to (a subset 
of) an application-specific roster.


I found numerous references to synapse so I downloaded the source which 
includes a .lpk library (it is several years old).  When I tried to 
compile it under Lazarus 1.1, fpc 2.6.2, the compiler could not find a 
method called inet_addr.  I searched the synapse source code and it 
showed numerous references to inet_addr, but no place where it was 
defined for fpc.  I hacked the code so it used linux rather than fpc and 
it failed while looking for unit libc, before ever getting to the 
inet_addr declaration.  I looked for libc and found that it is obsolete 
and does not seem to be available for 64-bit systems anyway.


Has anyone had success in using this library under Linux (x86-64)?

I also examined Indy (which I used successfully years ago on 
Delphi/Borland c++ Builder) but it, too, is obsolete (latest updates 
seem to be circa 2006) and comes with many, many warnings and caveats.


I found Mailpas (also from 2006) but I am having problems compiling the 
library -- it says it can't find a file which really is there where it 
is supposed to be.  -- During the long mailing list shutdown I found 
that the compiler message about a non-existent include file was wrong.  
The actual failure was that the include file uses libc which does not 
exist on my system (same problem as with synapse).  I'll submit a bug 
report as soon as I can.


Is there any other smtp and pop3 code available for Lazarus or will I 
have to generate my own from scratch?


Thanks,

Don Ziesig
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to send Email from Lazarus program under Linux x86-64

2013-03-26 Thread Donald Ziesig
Just a word of thanks to all who helped me with this.  Somehow I kept 
getting really old code from all of the links and none of it would 
compile in 64-bit mode, let alone run.


I finally found the synapse svn website which had a massive tarball with 
almost everything from the beginning to really up-to-date code.  The 
latest code compiled and started sending email immediately.


Again, thanks to all who recognized that I was not getting the latest 
and pointed me in the right direction.


Don Ziesig

END OF THREAD!


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


[Lazarus] Resources

2013-11-23 Thread Donald Ziesig

Hi All!

I have been trying to use a resource file (mydata.rc) to include some 
bitmap images in an app but with no success.  For simplicity, I have 
pared the rc file to a single line:


pix2 BITMAP /home/mydir/Desktop/myapp/2.bmp

I have the following lines in my main unit:

{$R *.lfm} // the original
{$R mydata.rc}

mydata.rc is being compiled.  It generates lib/x86_64-linux/mydata.res 
as expected.


I can see the following in the compiled lib/x86_64-linux/mydata.res file 
using od


B nul   I nul   T nul   M nul   A nul   P nul

and

P nul   I nul   X nul   2 nul

followed by the header of a bitmap image, so I am pretty sure that the 
resource compiler (windres) is working correctly.


When I try to load the bitmap using:

  Image1.Picture.LoadFromLazarusResource('PIX2');  // Tried 'pix2' as well

I constantly get Resource pix2 not found.

I put some diagnostics in LResources.pp and I can see other resources 
being found, and pix2 being sought but it never finds a resource from 
the mydata.res file.


It appears that whatever (I'm guessing here) has to be done to include 
the resources from mydata.res into the executable is not happening.


I am using Lazarus V 1.1, and FPC V 2.6.2

Can anyone point me in the right direction?

Thanks,

Don Ziesig

P.S.  I started with PNG graphics and ended up with BMP only because 
that seemed to be the least common denominator in the all of the docs I 
could find.









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


[Lazarus] Can't see (or set) border on TComboBox

2014-07-05 Thread Donald Ziesig

Hi All!

I just downloaded the latest Lazarus and FPC and now I can't get a combo 
box with a border :-( .


IIRC there used to be a way to select multiple border styles for 
TComboBox, but all I see now is:  BorderSpacing - 
(TControlBorderSpacing) and the resulting combo box has no visible border.


Am I missing something?

Thanks,

Don Ziesig


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


Re: [Lazarus] Can't see (or set) border on TComboBox

2014-07-06 Thread Donald Ziesig

On 07/06/2014 12:27 AM, Donald Ziesig wrote:

Hi All!

I just downloaded the latest Lazarus and FPC and now I can't get a combo
box with a border .

IIRC there used to be a way to select multiple border styles for
TComboBox, but all I see now is:  BorderSpacing -
(TControlBorderSpacing) and the resulting combo box has no visible 
border.


Am I missing something?


Don Ziesig

What widgetset ?

zeljko

According to the IDE build profile:  gtk 2

Don



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


[Lazarus] Can't get rid of heaptrace!

2014-07-10 Thread Donald Ziesig

Hi All!

I have a program that was working correctly.  I used heaptrc to get it 
that way:-) . Unfortunately, when I removed heaptrc from the uses clause 
in the project the program no longer starts.  Before the very first form 
is displayed, I get a SegFault in 
HEAPTRC_TRACEFREEMEMSIZE$POINTERS$QWORD$QWORD : 0077F7CA 
488b00   mov(%rax),%rax


I checked the project options and the use heaptrc box is unchecked.  I 
have tried reloading lazarus and rebooting the machine, neither of which 
changed the symptoms.  If I restore heaptrc to the uses clause, the 
program starts and runs properly.


I am using Linux Mint 17, 64bit and the most recent version of Lazarus 
and Free Pascal (all downloaded and installed last week).


Any suggestions?

Thanks,

Don Ziesig

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


Re: [Lazarus] Can't get rid of heaptrace!

2014-07-11 Thread Donald Ziesig
Fixed the problem.  My primary library somehow got compiled with 
heaptrc.  I couldn't find any way of removing heaptrc from the library 
so I created a new package, copied the source files into it, compiled it 
and added it back into the project.  Program runs fine now without 
heaptrace.


Thanks for the pointers.

Don Z

On 07/11/2014 02:47 AM, Reinier Olislagers wrote:

On 11/07/2014 04:06, Donald Ziesig wrote:

I have a program that was working correctly.  I used heaptrc to get it
that way:-) . Unfortunately, when I removed heaptrc from the uses clause
in the project the program no longer starts.  Before the very first form
is displayed, I get a SegFault in
HEAPTRC_TRACEFREEMEMSIZE$POINTERS$QWORD$QWORD : 0077F7CA
488b00   mov(%rax),%rax

I checked the project options and the use heaptrc box is unchecked.

Have you tried clean  rebuild? In project options, if you press the
show options button, can you verify that there's no -gh option?


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





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


[Lazarus] Where do lazarus apps look for dll's?

2014-07-31 Thread Donald Ziesig

Hi All!

Untill yesterday, I had a lazarus app on Windows that worked fine with 
PostgreSQL.  Now it keeps telling me it can't find libpq.dll. I have put 
libpq.dll in every directory that was recommend on many websites (e.g., 
in the app directory, in Windows\System32, Windows\SysWOW64, etc.) but I 
keep getting the error message when I try to start the app, and in the 
IDE when I try to connect the TPConnect component.  I've rebooted every 
time I copy the dll just in case.


The pgAdmin III app works fine and sees all the tables and their 
contents so Postgres is working properly.


I even re-installed Lazarus (and put the dll in it's directory)

Any ideas?

Thanks in advance,

Don Ziesig

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


Re: [Lazarus] Where do lazarus apps look for dll's?

2014-07-31 Thread Donald Ziesig

On 07/31/2014 06:45 PM, Maxim Ganetsky wrote:

01.08.2014 1:31, Donald Ziesig пишет:

Hi All!

Untill yesterday, I had a lazarus app on Windows that worked fine with
PostgreSQL.  Now it keeps telling me it can't find libpq.dll. I have put
libpq.dll in every directory that was recommend on many websites (e.g.,
in the app directory, in Windows\System32, Windows\SysWOW64, etc.) but I
keep getting the error message when I try to start the app, and in the
IDE when I try to connect the TPConnect component.  I've rebooted every
time I copy the dll just in case.

The pgAdmin III app works fine and sees all the tables and their
contents so Postgres is working properly.

I even re-installed Lazarus (and put the dll in it's directory)

Any ideas?


64-bit DLL versus 32-bit application or vice versa?


I will double check, but why would it change over night?


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


Re: [Lazarus] Where do lazarus apps look for dll's?

2014-08-01 Thread Donald Ziesig

Hi Again!

Thanks for all of the excellent suggestions.

After further investigation, it appears that the error 
message//is***misleading*.  Lazarus *IS* finding libpq.dll, but it is 
not able to load it because *OTHER *system-level dll's that libpq 
depends on are missing.  As mentioned before, it is possible that 
Windows Update caused the problem, but I haven't been able to confirm 
that yet.


I'll post the solution here when I find it.

After I get rid of all of the extraneous versions of libpq that I have 
scattered around my system ;-) .



Don Ziesig

On 08/01/2014 09:19 AM, Michael Schnell wrote:

On 08/01/2014 02:49 PM, Sven Barth wrote:


One *could* differentiate it. Windows.LoadLibrary() returns 
ERROR_MOD_NOT_FOUND if the file does not exist and 
ERROR_BAD_EXE_FORMAT if the file is not a PE file or the architecture 
does not match.




Nice !

But I suppose One *should* only differentiate if it can be done with 
other OSes, as well.


.
-Michael

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




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


Re: [Lazarus] Developing on Linux with files on Windows NTFS {Solved]

2015-02-06 Thread Donald Ziesig
Thanks to all who responded to my plea for help with multi-platform 
development.


It seems that I was mistaken about the time-stamps causing the problems 
I encountered.  The problems were caused by the fact that Lazarus for 
Linux wants case sensitive file names and the NTFS driver I was using 
was case insensitive.  The erroneous behavior that I was seeing was due 
to capitalization in unit names, not time-stamps.


The solution (as suggested by John Landmesser) was to use ntfs-3g (I put 
it into fstab and added my own uid/gid to avoid permission problems.  
fstab would not have been the proper solution if there were more than 
one user on the computer).  I also took the suggestion to use separate 
directories for the windows and linux project files.  This separated the 
object and executable files between the two systems as well.


I also found a windows driver for ext4 that does not corrupt the ext4 
file system.  It is available from Paragon Software (free for personal 
use, reasonably priced for commercial use).


It was suggested that I use svn for file sharing between windows and 
linux.  I actually use git for all my source control, but it did not 
solve the mixed case file name issue that was actually causing my 
problem between the two OSes.


Again, many thanks for all the great help.

Don Ziesig


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


[Lazarus] Developing on Linux with files on Windows NTFS

2015-02-05 Thread Donald Ziesig

Hi All!

I have been trying to develop a multi-platform app with the IDE on Linux 
(MInt) and the source files on a Windows NTFS partition.   I build and 
test on windows but my primary work is done on linux so I don't stay 
logged in to windows very long.


The problem I am having is that the Linux version of the IDE seems to 
get confused by windows time stamps (at least that's what the symptoms 
suggest).  When I save an edited file (either code or form), the IDE 
frequently (but not always) opens a copy of that file in a separate tab 
and complains when I edit and save one of the two instances.  It 
sometimes deletes the most recent edit, other times the obsolete file.


I haven't found a windows driver for ext4 that doesn't warn of potential 
corruption of the ext4 file system, otherwise I would develop with the 
source on linux and occasionally build on windows.


One alternative is to keep the master source on linux and copy it all to 
NTFS when I build/test on windows, but that has its own set of issues.


Has anyone had any success in using common storage for multi-platform 
source code?  If so, how do you do it?


Thanks,

Don Ziesig
'

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


[Lazarus] Developing on Linux with files on Windows NTFS [NOT Fully Solved]

2015-02-08 Thread Donald Ziesig
There is still one residual problem.  Right now I am developing and 
testing on Linux with the files on NTFS using ntfs-3g with case 
sensitive file names.  Everything seems to be ok until I get a 
compilation error at which point I get two editor windows pointing to 
the same file with tabs showing:


MyFileMyFile(2)

If I re-compile, a window pops up telling me that the file on disk has 
changed and asking if I would like to reload.  If I press reload I get 
the modified file, else I get the file from before the compilation 
error.  Strangely, the compilation error will re-occur even with the 
modified file showing in the source editor and the unmodified file 
closed in the source editor.  It doesn't seem to matter if I use 
file-contents or file timestamp to determine the modification state 
of the file.  Also, I have looked on the disk and see only the 
MyFile.pas, never MyFile(2).pas.


There is a simple work-around (which might give someone a clue as to the 
cause).  If I explicitly save the modified files before starting 
compilation the problem never occurs.  (I just have to remember to do it 
;-) ).


This never occurs when the files are on the Linux ext4 file system.

Don Ziesig

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


[Lazarus] TDBCalendar problems

2015-03-14 Thread Donald Ziesig

Hi All!

I have been trying to get the TDBCalendar control to update my database 
with no success.  If I manually update the date field in the table, the 
value is immediately reflected in the control - it changes to the 
correct date.  On the other hand, if I put the dataset in Edit or Insert 
mode and change the control's date, nothing happens after posting the 
data.  The field retains its original value (either blank or the date I 
manually entered).


While trying to debug this, I found a method 
TFieldDataLink.UpdateRecord which is invoked by many of the included 
files (*.inc) from DBCtrls.pp, but I can't find anywhere in the source 
code where this method is declared.  Since this is where I would expect 
the value to be written in the table,  and debugger step-into doesn't, 
I am at a dead end in debugging.


Am I missing something simple in the use of TDBCalendar (likely) or am I 
doing something that no one has ever tested (unlikely)?


Thanks,

Don Ziesig


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


[Lazarus] TComboBox.DropDownCount has no effect.

2015-04-04 Thread Donald Ziesig

Hi All!

I have several apps that use combo boxes for (e.g.) Minutes.  For 
Minutes, the items range from 0 to 59.   The Object Inspector shows that 
the DropDownCount is 8, but no matter what I put in there, I get the 
entirety of the items.   For Minutes, the selection box spans the 
display from the top to the bottom, with the top part being blank and 
the bottom (from the position of the control itself) with 0, 1, ... 
until it hits the bottom of the screen.


To test this, create an application, put a TComboBox on the form, 
populate the Items with a set of items having more than 8 entries. Run 
the app and look at the number of items in the drop-down list. Change 
the DropDownCount to something like 3 and try again.  It always shows 
every item in the list no matter what is put in the Object Inspector.  
Additionally, in the FormCreate event, try setting 
ComboBox1.DropDownCount to something less than the number of Items.  The 
new value is totally ignored.


I am using Lazarus 1.4RC2 with no modifications on Linux Mint 17.

Am I doing something wrong?

Thanks,

Don Ziesig

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


[Lazarus] Very strange errors when editing programs using Frames

2015-04-08 Thread Donald Ziesig

Hi All!

I'm not sure if the following is a new bug or whether it only occurs in 
Lazarus for Windows

1.4RC2 or RC3.

I have been testing Lazarus 1.4RC2 and now Lazarus 1.4RC3 on Windows 7 
and have encountered
strange behavior with frames.  I have simplified the code down to an app 
that displays
a very simple frame after a button push.  There is only one *unusual* 
factor in this app
(but it is common to many programs I wrote in Delphi and Lazarus for 
Linux).  That is,
I subclass TFrame to add functionality to all descendent frames, for 
example:


TFrameX = class(TFrame)

  public Print; virtual;   // Now the main program can call Print 
on a framex and
// the frame-specific printing 
occurs.


  constructor Create; override;
end;

the remainder of the frames in the apps are subclassed from TFrameX.

TFrame1 = class(TFrameX) ...

The issue is that when editing the MAIN program's appearance using the 
Object Inspector,
(specifically changing *Position*),  the .lfm file for the FRAME 
/occasionally/ gets an entry
for*Position*!  (sometimes *TabOrder*, too.).  I can't pinpoint exactly 
the time at which
this extraneous data appears, but it doing a series of normal editing 
operations such as
moving the windows, changing the properties of the MAIN or FRAME for a 
few minutes
(but not changing the code) will definitely cause it to happen. Once it 
does, the object
inspector for Frame1 has an entry for *Position* (and sometimes 
*TabOrder*) which is not
present when a frame is first created.  After this appears, reloading 
the Frame form
will /sometimes/ raise an exception in the IDE complaining about the 
unknown property

for the Frame.

The intermittent (apparently) nature of this is puzzling.

Subsequently, when I attempt to run the program, one of two possible 
situations occur:


1.Clicking on the button that displays the frame calls the code but 
does not display

the frame, or,
2.Clicking on the button raises an exception describing the 
extraneous entry in the

.lfm file.

I haven't been able to figure out why one or the other happens, but for 
any given

compilation the error remains the same.

I have a simple app that demonstrates this problem if anyone would like 
to try to

replicate my troubles ;-) .

Thanks,

Don Ziesig
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TOpenDialog causes debugger error on exit from program.

2015-04-08 Thread Donald Ziesig

On 04/08/2015 12:41 PM, Martin Frb wrote:

On 08/04/2015 17:17, Martin Frb wrote:



There are several known problems (especially win 7 and up) where gdb 
7.2  does not like the dll loaded for the open dialog (shell 
extensions or something)


Workaround is
http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#gdb.exe_has_stopped_working 



I have added a note on the download page (readme.txt / displayed on 
the bottom of the page.)


--

Thanks Martin.  That workaround corrected the problem.

Don

___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus





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


[Lazarus] TOpenDialog causes debugger error on exit from program.

2015-04-08 Thread Donald Ziesig

  Found another bug. This one is repeatable all of the time.

Very simple demo.  Create a new project.  Put a TOpenDialog on the
form.  Then put two buttons.  Button2 calls Close.  Button1
has the following code in the onclick handler.

if OpenDialog1.Execute then;

Run the program.  Click Button2.  The program exits normally.
Run the program again.  Click Button1.  When the open dialog
appears, select a file at random (since it will not be touched
by the program).  Then Click Button2.  The Debugger raises an
exception GDB as encountered an internal error: ... 

This occurs in RC3 for Win32.

Don Ziesig




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


Re: [Lazarus] Very strange errors when editing programs using Frames

2015-04-08 Thread Donald Ziesig

On 04/08/2015 05:01 PM, Mattias Gaertner wrote:

On Wed, 08 Apr 2015 09:58:32 -0400
Donald Ziesig don...@ziesig.org wrote:


[...]
(specifically changing *Position*),  the .lfm file for the FRAME
/occasionally/ gets an entry
for*Position*!  (sometimes *TabOrder*, too.).  I can't pinpoint exactly
the time at which
this extraneous data appears, but it doing a series of normal editing
operations such as
moving the windows, changing the properties of the MAIN or FRAME for a
few minutes
(but not changing the code) will definitely cause it to happen. Once it
does, the object
inspector for Frame1 has an entry for *Position* (and sometimes
*TabOrder*) which is not
present when a frame is first created.  After this appears, reloading
the Frame form
will /sometimes/ raise an exception in the IDE complaining about the
unknown property
for the Frame.

Do you mean Position or Left, Top?

Position as in poDesigned

TabOrder is a normal TFrame property. It is set automatically by the
LCL for all controls.

  
This may be true, but one of the errors is an exception caused by an 
invalid property TabOrder.

It doesn't happen frequently, but I have seen it more than once.

The intermittent (apparently) nature of this is puzzling.

Subsequently, when I attempt to run the program, one of two possible
situations occur:

1.Clicking on the button that displays the frame calls the code but
does not display
  the frame, or,
2.Clicking on the button raises an exception describing the
extraneous entry in the
  .lfm file.

I haven't been able to figure out why one or the other happens, but for
any given
compilation the error remains the same.

I have a simple app that demonstrates this problem if anyone would like
to try to
replicate my troubles ;-) .

Please create a bug report.


Will do (as soon as I return to Windows ;-) ).


Mattias

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





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


[Lazarus] Is it possible to change LazLogger to use unbuffered output?

2015-04-08 Thread Donald Ziesig

Hi All!

LazLogger is quite useful in debugging components, but it would be much 
more useful if the output were unbuffered such that lines written to 
DebugLn would show in the terminal immediately.  Right now, only a 
portion of the debug output appears unless I append many dummy 
characters to the debug output to flush the output buffer. Otherwise I 
can't see all of my output until well after it has been written.


Don Ziesig

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


Re: [Lazarus] OOP - where do you start?

2015-06-26 Thread Donald Ziesig

Hi Graeme,

As mentioned in one of the earlier replies, it really depends on the 
complexity of the application and the state of the Business Rules.


If I have a detailed definition of the Business Rules (a really rare 
occurrence), I will start with the BOM and UI.  I sometimes build in 
some data fixtures without ever touching the database till I am 
reasonably sure that the BOM/UI and Fixtures describe the Business 
Rules.  Then I will start moving the fixtures into the schema one or two 
at-a-time with constant testing.


When I don't have a detailed definition of the rules (the usual case), I 
start with top-level rules and one or two top-level tables, their 
associated BOMs and UIs.  After each set of BOM/UI/Tables I sit down 
with the customer and demonstrate what I have so far.  We then agree on 
any changes that must be made and we iterate till that set of 
requirements are being satisfied. Often we also agree on what part of 
the rules should be implemented next.


Most of the time, the customer waves her hands to describe what the 
program must do, so it is up to me to actually start developing the 
Business Rules.  When that happens, the second approach helps by 
reducing the amount of throw-away code required till the customer gives 
his/her approval.  (Especially when the customers are my own daughter 
and grand-daughter).


My most recent project was a translation of a pre-Windows c++ program 
with a CLI for the user interface and no database into Lazarus with 
sqlite3.  Since the rules were well established, just implemented with 
very old technology, I used the first approach and it worked very well.  
I had almost the entire program working in test mode before I had to 
touch the database for production.


Hope this helps.

Don Ziesig, ROP (Really OLD Programmer);-)

On 06/26/2015 07:30 AM, Graeme Geldenhuys wrote:

Hi,

Last night I was working on a relatively new project. This got me
thinking... How do others tackle such a task?

So here is my question:

   When faced with a new database related project, where do you start? Do
you first design the database schema, then build the BOM (Business
Objects) accordingly? Or, do you first design the BOM, then design the
database schema to fit.

Personally, most of my project were started by first creating the
database schema. Don't ask me why, that is just what I did. Maybe it was
because many of the tools I use, can write much of the boiler plate code
for me, and they do that by querying a database structure. But I've been
thinking that with my next project, I'm going to start with the BOM
first, and see how it goes. I'm assuming the end result should be the
same, no matter which part I tackled first.

What's your thoughts?

Regards,
   - Graeme -




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


[Lazarus] Breakpoints not working

2015-08-13 Thread Donald Ziesig

Hi All,

I just updated my windows (ugh) version of Lazarus to 1.4. Everything 
seems to be working fine except breakpoints are not breaking.   They are 
listed in the breakpoints window with the break property set true, but 
execution goes wizzing by them without stopping.


Any ideas on what went wrong?

Thanks,

Don Ziesig

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


Re: [Lazarus] Breakpoints not working [solved]

2015-08-13 Thread Donald Ziesig

On 08/13/2015 12:27 PM, Donald Ziesig wrote:

Hi All,

I just updated my windows (ugh) version of Lazarus to 1.4. Everything 
seems to be working fine except breakpoints are not breaking.   They 
are listed in the breakpoints window with the break property set true, 
but execution goes wizzing by them without stopping.


Any ideas on what went wrong?

Thanks,

Don Ziesig

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


For some strange reason the project options flag to generate gdb got 
turned off.  Set it true and recompiled.  Breakpoints now break.


Don Z.

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


Re: [Lazarus] Where is hwiringPi?

2015-09-19 Thread Donald Ziesig

On 09/18/2015 08:34 PM, Donald Ziesig wrote:

On 09/18/2015 07:50 PM, Bo Berglund wrote:

On Sat, 19 Sep 2015 01:21:25 +0300, Maxim Ganetsky <gan...@narod.ru>
wrote:


19.09.2015 1:10, Donald Ziesig ?:

Hi All!

It looks like this is Raspberry PI day :-) .

I have Lazarus working on a RPi 2 B with no problems til now.

(Started with monitor, keyboard and mouse till I got ssh and vnc 
setup,

then switched to Remmina on my laptop via tcp/ip).

I need to access the GPIO pins from my Lazarus program.  I have found
the C library "wiringPi" and many references to the FPC "hwiringPi"
package that wraps it, but I'll be darned if I can find "hwiringPi" 
itself.

Strange, that you couldn't find it. This site:

https://github.com/AkselMeola/Pascal-projects-on-Raspberry/tree/master/Morse-code-translator 


\
is the first for the "hwiringPi" Google query.

Strangely I also need this for my RPi2 project!
The software needs to pull two relays as part ofthe automation. So
GPIO access is needed.
Now that it popped up may I inject a question here:

The hiwiringpi.pas file is an interface to something else written in C
if I understood the text correctly.
How does that work? It seems like I have to compile something in C on
the Pi as well and it produces an *.o file. Does that act like a dll
in Windows or like a lib file that gets linked into the final
executable?

I am not really (yet) familiar wth programming in Linux


There is a package written in C called wiringPi which is available on 
github.  You will need to clone it and follow the instructions to 
build it.  The hwiringPi package links to the wiringPi.o file in the 
wiringPi directory.  As of right now, I am getting a linking error 
which seems to be rather common (there are many references to it 
online) because I am using the latest RPi version 2 B.


Unfortunately my ISP has dropped my connection due to a thunderstorm 
so I am working on my cell phone (very slow).  I think I'll wait until 
tomorrow to look any further.


Don Z


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


I got it working8-) . It seems that the appropriate wrapper is 
*h2wiringPi* (as opposed to *hwiringPi*).  cloned that from github, set 
the paths correctly, edited my uses clause and the program compiled, 
linked and ran successfully.


Thanks all for pointing me in the right direction.

Don Z.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Where is hwiringPi?

2015-09-18 Thread Donald Ziesig

On 09/18/2015 07:50 PM, Bo Berglund wrote:

On Sat, 19 Sep 2015 01:21:25 +0300, Maxim Ganetsky <gan...@narod.ru>
wrote:


19.09.2015 1:10, Donald Ziesig ?:

Hi All!

It looks like this is Raspberry PI day :-) .

I have Lazarus working on a RPi 2 B with no problems til now.

(Started with monitor, keyboard and mouse till I got ssh and vnc setup,
then switched to Remmina on my laptop via tcp/ip).

I need to access the GPIO pins from my Lazarus program.  I have found
the C library "wiringPi" and many references to the FPC "hwiringPi"
package that wraps it, but I'll be darned if I can find "hwiringPi" itself.

Strange, that you couldn't find it. This site:

https://github.com/AkselMeola/Pascal-projects-on-Raspberry/tree/master/Morse-code-translator
\
is the first for the "hwiringPi" Google query.

Strangely I also need this for my RPi2 project!
The software needs to pull two relays as part ofthe automation. So
GPIO access is needed.
Now that it popped up may I inject a question here:

The hiwiringpi.pas file is an interface to something else written in C
if I understood the text correctly.
How does that work? It seems like I have to compile something in C on
the Pi as well and it produces an *.o file. Does that act like a dll
in Windows or like a lib file that gets linked into the final
executable?

I am not really (yet) familiar wth programming in Linux


There is a package written in C called wiringPi which is available on 
github.  You will need to clone it and follow the instructions to build 
it.  The hwiringPi package links to the wiringPi.o file in the wiringPi 
directory.  As of right now, I am getting a linking error which seems to 
be rather common (there are many references to it online) because I am 
using the latest RPi version 2 B.


Unfortunately my ISP has dropped my connection due to a thunderstorm so 
I am working on my cell phone (very slow).  I think I'll wait until 
tomorrow to look any further.


Don Z


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


Re: [Lazarus] Where is hwiringPi?

2015-09-18 Thread Donald Ziesig

On 09/18/2015 06:21 PM, Maxim Ganetsky wrote:

19.09.2015 1:10, Donald Ziesig пишет:

Hi All!

It looks like this is Raspberry PI day :-) .

I have Lazarus working on a RPi 2 B with no problems til now.

(Started with monitor, keyboard and mouse till I got ssh and vnc setup,
then switched to Remmina on my laptop via tcp/ip).

I need to access the GPIO pins from my Lazarus program.  I have found
the C library "wiringPi" and many references to the FPC "hwiringPi"
package that wraps it, but I'll be darned if I can find "hwiringPi" 
itself.


Strange, that you couldn't find it. This site:

https://github.com/AkselMeola/Pascal-projects-on-Raspberry/tree/master/Morse-code-translator 



is the first for the "hwiringPi" Google query.

Got it.  I have cataract surgery upcoming :-( , that would have helped 
me see in when I looked at it :-[ .  Thanks.


Don Z

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


[Lazarus] Where is hwiringPi?

2015-09-18 Thread Donald Ziesig

Hi All!

It looks like this is Raspberry PI day :-) .

I have Lazarus working on a RPi 2 B with no problems til now.

(Started with monitor, keyboard and mouse till I got ssh and vnc setup, 
then switched to Remmina on my laptop via tcp/ip).


I need to access the GPIO pins from my Lazarus program.  I have found 
the C library "wiringPi" and many references to the FPC "hwiringPi" 
package that wraps it, but I'll be darned if I can find "hwiringPi" itself.


Everything points to Alex's Lazarus forum post which starts:

"Hello,
please find attached a wrapper unit for Gordon Henderson's
wiringPi C library (https://projects.drogon.net/raspberry-pi/wiringpi) 
and a little Lazarus test program."


I can't find the attachment, and I can't find any other references to 
the code.


Help, please :'( .

Thanks,

Don Ziesig


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


[Lazarus] Error: OOPS, I lost your class.

2015-12-08 Thread Donald Ziesig

Hi Everyone!

I am using Lazarus 1.5 on a Raspberry Pi B 2 and I just encountered an 
error I have never seen before while editing.


I am creating a new generic class as in:

type
  generic TMyClass = class(TMyBaseClass)
 public
constructor Create( AParent : TMyBaseClass = nil);
destructor  Destroy; override;
  end;

When I hit  for auto complete, I get the message "Error:  
OOPS, I lost your class" and the implementation section looks like this:


implementation

{  }

constructor Create( AParent : TMyBaseClass);
begin

end;

destructor Destroy;
begin
  inherited Destroy;
end;

end.

This is a much simplified example.  Code completion fills in the 
declarations from properties correctly, but the generated setters and 
getters also come out in the {  } with no class name either.


Am I doing something wrong?  I have been using this since IIRC Delphi 5 
and never encountered this error.  (Of course generics may have come 
later than Delphi 5,  but I have used code completion in generics well 
into the past, just can't remember when I started :-( ).


Help making this work will eliminate a lot of typing (and potential errors).

Thanks,

Don Ziesig

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


[Lazarus] How to pass function method to TList.Sort?

2015-12-09 Thread Donald Ziesig

Hi All!

Is there any way to pass a method function as the Compare parameter to a 
TList or is there a work around for it?


There are generics involved so it won't let me access the static symbol 
table.


As in:

type
  TMyClass = object
 fIndex : Integer;
 List : array of TList;
 function Compare( Item1, Item2 : Pointer) : Longint; // needs 
access to fIndex


 procedure Sort;
  end;

implementation

function TMyClass.Compare( Item1, Item2 : Pointer ) : Longint;
begin
   case fIndex of
  0:  Result := some compare of Item1, Item2;// These compares are 
implemented in an object from another unit

  1:  Result := another compare of Item1, Item2
   end;
end;

procedure TMyClass.Sort;
begin
  fIndex := 0;

  List[fIndex].Sort( @Compare );  // Compilation error, doesn't like 
Compare being "of object"


end;


Thanks,

Don Ziesig


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


Re: [Lazarus] Lazarus compile project via ssh?

2015-12-20 Thread Donald Ziesig

On 12/20/2015 07:52 AM, Anthony Walter wrote:

Thanks everyone for your replies.

Regarding cross compilation, my code contains a sections linking to 
the broadcom driver and several other files (a whole slew of different 
vchi modules), which in turns links to many other files. For cross 
compile to work I would need to find all the required libs and static 
files (*.a) file upon which they depend to cross compile. And for the 
static libs link order needs to be preserved 
(http://stackoverflow.com/questions/45135/why-does-the-order-in-which-libraries-are-linked-sometimes-cause-errors-in-gcc) 
or compilation fails. On the Pi I use a have config program (provided 
by broadcom) in an ifdef withing my Pi's fpc.cfg. The config program 
dynamically generates settings for the gnu ld command to produce the 
correct static lib order.


Rather than trying to solve these types of linking issues (not to 
mention the generating the correct hard float cross compiler) on my 
desktop PC, I thought my current workflow was easier a lot easier.


Also, the ssh method for me has the added benefit of allowing me to 
execute my Pi program from a terminal on my desktop PC, and see the 
results in that terminal as the Pi brings up a full screen UI on 
another monitor. See this video taken from another developer -> 
https://www.youtube.com/watch?v=GhWs_3_SuW0 .The difference my case is 
that I've written code to control a fullscreen Pi app through the ssh 
terminal, while on the Pi the terminal is not visible/accessible.



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

Hi Anthony,

I gave up on cross compiling, but I have had much success developing on 
the pi using VNC/SSH.  The pi is overclocked to 1000Mhz and the 
responsiveness is satisfactory when compared with my quad-core laptop.  
The nice thing is that I only need one keyboard, display and mouse.  The 
only bad thing is that I haven't figured out how to share the 
clipboard.  (VNC says it can sync clipboards but it doesn't work for me.)


My next move will be to store the source code on the laptop and access 
it from the pi.  I did this (storing common source code) between Linux 
Mint and Windows.  It worked except that Lazarus on Linux got confused 
about the modified status of files saved on Windows and vice versa.


Now, if anyone could give me a script or recipe for setting up FPC 3.0.0 
and Lazarus 1.6RC2 on a virgin installation of Raspbian I would be truly 
thankful  (Preferably from source).  Everything I tried so far keeps 
telling me I need to run *fpcmake* because it doesn't know about the 
target.  I think I am missing parameters to the *make* command for 
either or both.  At one point I had FPC 3.0.1 working, but Lazarus kept 
complaining about needing fpcmake.


Don
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Syntax error compiling fpc 3.0.0 3.0.0rc1 3.0.0rc2

2015-12-19 Thread Donald Ziesig

Hi All,

I ran out of room on the raspberry pi's 8GB NOOBS SD card so I just 
created a new SD 16GB card with the latest version of Raspbian.  I got 
all of the usual tools working in short order (VNC, SSH, FTP,...).


Then I decided to build a completely new version of FreePascal and 
Lazarus from source (just to prove that I can ;-) ), but I can't compile 
any style of fpc 3.0.0 from:


svn co http://svn.freepascal.org/svn/fpc/tags/release_3_0_0_rc2 fpc2
svn co http://svn.freepascal.org/svn/fpc/tags/release_3_0_0_rc1 fpc1
svn co http://svn.freepascal.org/svn/fpc/branches/fixes_3_0 fpc

I am using fpc 2.6.4 as the bootstrap compiler.

The error is consistent at flt_pack.inc, line 119.  The message is 
"Syntax error while parsing a conditional compiling expression".


I looked at the code and although it is not a trivial expression, I 
can't see anything wrong with it (unless one of the conditional define 
values is erroneous):


{$if defined(fpc_softfpu_implementation)
   or ( defined(FPC_SYSTEM_HAS_extractFloat64Frac)
 and defined(FPC_SYSTEM_HAS_extractFloat64Exp)
 and defined(FPC_SYSTEM_HAS_extractFloat64Sign)
)}

I am using the command:

make clean all OPT="dFPC_ARMHF -CX -CfVFPV2 -CaEABIHF -OpARMV6 -O2 
-XX -Xs"


from mitchelcomputing.co.uk (slightly modified).

==

I tried commenting out the entire conditional statement and replacing it 
with a failing conditional:


{$ifdef DRZ} // DRZ is not defined.

The compilation then ran to completion but the build failed because 
"Binary files ppp3 and ppcarm differ".  (Why there are two executables 
and what it means that they are different is beyond me :-[ ).


That error message is followed by many "recipe failed" messages.

Both ppp3 and ppcarm (which were left in the compiler directory) execute 
successfully in that they report version 3.0.1 for arm with detailed 
usage information.  I haven't tried compilation with them (yet).  I will 
try "hello world" a little later today (have to run an errand for my 
wife) and report the results.


I don't want to spend the time compiling Lazarus till I get a clean 
build and install of fpc.


Any help will be appreciated.

Thanks,

Don Ziesig

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


Re: [Lazarus] Raspberry Pi bundles now available

2015-12-18 Thread Donald Ziesig

Hi Anthony,

What version of Lazarus is installed with this script?

Thanks for the great work.

Don Ziesig

On 12/06/2015 10:18 PM, Anthony Walter wrote:
I've uploaded a few Raspberry Pi files and scripts at 
http://www.getlazarus.org


This is a minimal fpc 3.0.0 compiler. It's stripped down to be small 
and only includes the compiler, the text mode IDE, and the run time 
library. It's a good starting point on the Raspberry Pi if you want to 
do command line compiling using only the rtl or if you want to use it 
as a starting point for building the fpc trunk or other compiler 
branches on your Raspberry Pi. Total install size will be 45MB, for 
those of you conscious about using up the limited space on your Pi's 
SD card.


http://cache.getlazarus.org//archives/fpc-3.0.0.raspberry-min.tar.gz

Just download the above then "fpc-3.0.0.raspberry-min.tar.gz && 
./setup.sh". The setup does not need super user rights. It will let 
you choose a fpc compiler installation location, somewhere under your 
$HOME, and give you the option to create a shortcut to a terminal 
where the fpc environment is ready for you. That is with the minimal 
fpc 3.0 in your path and fpc.cfg environment variable configured.


Another, possibly more useful bundle I've created is Free Pascal 3.0 
with Lazarus for the Raspberry Pi. I've taken great care to reduce the 
install size of both fpc and Lazarus with this bundle for the Pi.


I've eliminated a lot of fpc packages which don't make sense to have 
on a Pi. All cross platform package and runtime files have been 
removed (I don't imagine people cross compiling from the Pi to say 
Windows for example). I've also eliminate the lazarus tool sources, 
source images files (res files remain), and quite a few components 
which are very unlikely to be used on the Pi. Basically I've gotten 
the install size from a full fpc and lazarus from 1.5GB down to around 
216MB.


If you're interested in trying this version of Free Pascal 3.0 with 
Lazarus, here is where you can get it:


http://www.getlazarus.org/setup/?download#raspberry_pi

If you have a Pi, just follow the instructions in the setup script. 
You can choose your install folder and have the option to creaate a 
application shortcut you can pin to the Pi menu,


In the next week I'll be working on updating the other platform 
installers to include a minimal versiomn, as well as updated install 
scripts where you can choose you install folder and create more 
shortcuts, be they fpc terminal shortcuts or applicationd esktop 
shortcuts.


Pi users, if your interested I am developing an SDL 2 installer along 
with a few bare demos which should work with either the minimal or the 
more complete compilers mentioned above. Let me know if you're 
inerested in using the SDL 2 on the Pi and I may setup a forum for it.



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


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


[Lazarus] Obviously I'm missing something.

2015-12-21 Thread Donald Ziesig

Hi All!

I have been beating my head against the wall trying to get the latest 
versions of fpc and lazarus installed on an almost plain vanilla 
Raspberry Pi.


The reason I say "almost plain vanilla" is that I have setup TightVNC, 
ftp, svn, etc. on a 16GB SD card loaded with raspbian-jessie.  I have 
this backed up on my laptop so I can restart from a usable configuration.


Up until now, I have fpc 2.9.4 and Lazarus 1.5 working on a NOOBS SD 
Card (that is too small for what I need to do).  That version of Lazarus 
has a bug that has been fixed in 1.6 so I would like to get 1.6 or 1.7 
working.



I am using an example tracked down from the FreePascal.org website. The 
ultimate website is:


http://www.tweaking4all.com/hardware/raspberry-pi/install-lazarus-pascal-on-raspberry-pi-2/#getfpc

Going step-by-step from this site:

It says to install fpc 2.6.4 as the bootstrap compiler.  Another place 
says 3.0.0 is the

required bootstrap.  I can't find 3.0.0 for Pi so here goes with 2.6.4.

# sudo su
# mkdir /usr/local/fpc
# cd /usr/local/fpc
# wget 
http://sourceforge.net/projects/freepascal/files/Linux/2.6.4/fpc-2.6.4.arm-linux.tar

# tar xvf fpc-2.6.4.arm-linux.tar
# cd fpc-2.6.4.arm-linux

### answer first prompt with /usr/local, the rest with 

# ./install.sh
# cd /usr/local/fpc
# svn co http://svn.freepascal.org/svn/fpc/trunk source
Checked out revision 32692.

# cd source
# make all OPT=-dFPC_ARMHF

Much text, followed by

types.pp(652,17) Error: function header doesn't match the previous 
declaration "TRectF.Union(const TRectF):;"

types.pp(667) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Makefile:3711: recipe for target 'types.ppu' failed

-

I have tried various combinations of suggestions from this website and 
others and have yet to be able to get fpc and/or lazarus to compile and 
install from sources.  The errors are different, but the result is the 
same: no fpc/lazarus.:'(


Can anyone point me to instructions/examples that work on the Raspberry 
Pi using raspbian-jessie?


Thanks,

Don Ziesig.

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


Re: [Lazarus] Syntax error compiling fpc 3.0.0 3.0.0rc1 3.0.0rc2

2015-12-19 Thread Donald Ziesig

On 12/19/2015 05:53 PM, Anthony Walter wrote:
Donald, if all you want is a minimal FPC 3.0.0 for the Pi, I suggest 
you use my minimal installers from http://www.getlazarus.org


The minimal version weights in at 40MB and includes the compiler, a 
few tools like the console "fp" ide, and the rtl (no fcl, no lcl). I 
also includes a fpc terminal shortcut which opens you default terminal 
with fpc envirnonemt variables and configuration setup. It will not 
interfere any other existing FPC or Lazarus setup. It also makes for a 
good starting point to make the FPC compiler from sources:


Minimal Pi PFC 3.0.0:

http://cache.getlazarus.org/archives/fpc-3.0.0.raspberry-min.tar.gz

If on the other hand you want to run a newer version of Lazarus with 
FPC 3.0.0 on the Pi, I also have a bundle for that. It's also quite 
small (I know SD card space on the Pi is a concern) at under 200MB for 
FPC 3.0.0 plus Lazarus. The FPC in this bundle comes with rtl, fcl, 
and a few other packages (again some have been removed), and the 
Lazarus version has had the graphic image sources, and tool sources 
removed (though tool binaries are included).


This reduced in size and Pi specific FPC 3.0.0 with Lazarus can be 
installed from here:


http://www.getlazarus.org/setup/?download#raspberry_pi

Final note:

I know many Pi users are concerned about the SD storage space required 
by FPC and Lazarus and I've taken some care to reduce their sizes on 
Pi, but please be aware more SD space will be used and is required 
when compiling with Lazarus. The first time you build with Lazarus it 
will require space to store the lcl compiled units (two hundred plus 
megabytes more), and any lcl programs you write and compile can take 
upwards of 20-30MB each. If you want to keep some of your compiled 
programs around, consider using the "strip -s yourprogram" utility to 
reduce their size after you're done developing a program. The storage 
saving will be significant.







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

Hi again Anthony,

I used your tiny version on my original SD card and it works fine, but I 
need the full-up debugging version on the big SD card.  With the 
additional 8 GB I don't think I'll have space problems.  If I do, I'll 
remove Python and Mathematica like I did on the original SD card.  That 
freed up a lot of space.


Thanks,

Don
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Do we really need a PaintSwastika procedure?

2016-01-08 Thread Donald Ziesig

My two cents.

This has gotten completely out of hand.  When an item has multiple 
meanings (e.g., artistic, religious or offensive political history) we 
should give it the benefit of the doubt and LEAVE IT IN.


This is Lazarus (an international programming organization), not a 
totalitarian regime.  As was exemplified before, should we paint a Hindu 
who is printing a religious symbol with the same brush as a Neo-Nazi?  I 
say NO.  Most people who are technically competent enough to install and 
use Lazarus have the ability to draw anything they want anyway.


PLEASE, LET'S TERMINATE THIS THREAD, NOW!

Don Ziesig

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


[Lazarus] Conditional Defines for Raspberry PI?

2016-01-13 Thread Donald Ziesig

Hi Everyone!

Are there any conditional defines that let me exclude PI-specific code 
when compiling for 64-bit amd linux (or vice-versa)?


I can define my own if necessary, but that is one more thing to worry 
about when switching machines.


Thanks,

Don Ziesig

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


Re: [Lazarus] Conditional Defines for Raspberry PI?

2016-01-13 Thread Donald Ziesig

On 01/13/2016 11:29 AM, Sven Barth wrote:


Am 13.01.2016 17:03 schrieb "Donald Ziesig" <don...@ziesig.org 
<mailto:don...@ziesig.org>>:

>
> Hi Everyone!
>
> Are there any conditional defines that let me exclude PI-specific 
code when compiling for 64-bit amd linux (or vice-versa)?

>
> I can define my own if necessary, but that is one more thing to 
worry about when switching machines.


Raspberry Pi is an ARM so you could check for CPUARM. 64-bit x86 Linux 
would be CPUX86_64 (for completeness: CPUI386 is for 32-bit x86).


Regards,
Sven



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

Thanks - just what I needed.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Debugging in Libraries.

2016-01-18 Thread Donald Ziesig

Hi All:

I have encountered a problem doing things that used to work.  (Using 
Lazarus 1.4.4 on Linux and 1.4.2 on Raspbian)


Specifically, I can no longer step into subprograms in library units, 
and when I set a breakpoint in the library code it is colored dull green 
as opposed to bright red in the main program.  Some, but not all, of the 
library code is implemented using generics.


I can't see anything I am doing differently than before (except that I 
copied the entire source for the program and library from a Raspberry 
PI, including the configurations.  The PI also had this problem).


Can anyone give me a hint as to where I should start looking to fix this?

Thanks,

Don Ziesig

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


Re: [Lazarus] Debugging in Libraries.

2016-01-18 Thread Donald Ziesig

On 01/18/2016 03:13 PM, Martin Frb wrote:

On 18/01/2016 18:34, Donald Ziesig wrote:

Hi All:

I have encountered a problem doing things that used to work. (Using 
Lazarus 1.4.4 on Linux and 1.4.2 on Raspbian)


Specifically, I can no longer step into subprograms in library units, 
and when I set a breakpoint in the library code it is colored dull 
green as opposed to bright red in the main program. Some, but not 
all, of the library code is implemented using generics.


I can't see anything I am doing differently than before (except that 
I copied the entire source for the program and library from a 
Raspberry PI, including the configurations.  The PI also had this 
problem).


Dull green, usually (check debug output window) means that gdb 
returned, that there is on code on the requested line/number.

will do.


With generics, usually the oposite is the case, there are several 
blocks of code containing the location (and on windows, I have seen 
gdb handling that, at least in some cases).


come to think of it, IIRC gdb handled generics in windows, but that was 
back on Lazarus 1.0.  I have been working exclusively on Linux and 
Raspbian for the past 2 years.


The question then is, if fpc did generate sufficient debug info or if 
gdb has an issue.  (try stabs and dwarf)


will do.
Forgot to mention that gdb itself occasionally crashes when working 
around this code!




ensure you disable "inlining"


where?


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



Martin,

Thanks for the pointers.

 I discovered something since I wrote the last email:  gdb works 
(except for occasional failures in generics) if I compile the whole 
thing (Run | Cleanup and Build ...) in Linux.  Lazarus itself is 
protected so I have to skip the errors.   (I just upgraded this laptop 
to an SSD so the Cleanup and Build runs faster than just-plain Compile 
on the original HDD ... Yippy!!!).  I haven't tried it on Raspbian yet.


Don

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


Re: [Lazarus] How to separate window editor from code.

2016-02-08 Thread Donald Ziesig

On 02/08/2016 08:12 PM, leledumbo wrote:

How can I restore this to the way it was back on 1.4?

Uninstall sparta_dockedformeditor package.



--
View this message in context: 
http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-How-to-separate-window-editor-from-code-tp4047123p4047127.html
Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com.

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

Thanks, sometimes improvements aren't improvements.  (Especially since I 
have been using separate editors since Delphi 2.)




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


[Lazarus] How to separate window editor from code.

2016-02-08 Thread Donald Ziesig

Hi All!

I recently updated raspberry pi to 1.7.  When I did, the window editor 
became a tab in the source editor.  This is a real problem. I can't 
figure out how to tell the window where it was designed. Now it will 
center on screen, on parent form, etc, but I want to put it into a 
specific place on the screen.  I have tried to find the option that lets 
me have separate code and window editing, but no luck.


How can I restore this to the way it was back on 1.4?

Thanks,

Don Ziesig


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


[Lazarus] Bug in MY code. fpc 3.0.0 did NOT detect - leads to strange error.

2016-02-12 Thread Donald Ziesig

Hi All!

After a multi-day debugging binge, I found the problem described in my 
previous email.


Quick summary:

Common Library has a unit which defines a generic class that itself is 
derived from a class from another unit of the same library.


Application Library has many units which specialize the generic class.

Compiling the Application LIbrary causes a "File not found" error giving 
the name of a valid file (the one declaring the generic) but in an 
incorrect directory,  There is no indication of where the failure 
(file:line no) occurs.  There is no sign of the file where the error 
message says it is (that part is correct, but why it happens is not).


A long series of tests determined that the error occurs in all files 
that specialize the generic class.  I had not touched the file declaring 
the generic class in years.


The bug in my code was in the Common Library unit that declared the 
class from which the generic class was derived.  FPC 3.0.0 did not 
detect the following error in the class declaration:


class function Load( TextIO : TTextIO; aParent : TPersists = nil ) 
: TPersists; virtual; overload; // Calls read afterwards


procedure Load( TextIO : TTextIO ); overload; // Loads without 
creating *<<< this was newly added and caused the p**roblem. fpc did not 
object!


*This module is many years old. I know now that the class function could 
have been replaced by a constructor, but that would require refactoring 
many working programs.


I added the procedure recently to simplify a lot of application code 
(which it did).  It had been working without the error for a few days.  
I don't know what I did to trigger the failure, but once I did it would 
not go away (that in itself is problematic, I would have expected the 
failure right after I introduced the bug).


The first instance of the error occurred using Lazarus 1.7/fpc 3.0.0 on 
Raspbian.  During the bug hunt, I copied the code to my laptop where it 
occurred using Lazarus 1.6RC2/fpc 3.0.0 on Linux Mint 17.3.


When I changed the code to:

class function Load( TextIO : TTextIO; aParent : TPersists = nil ) 
: TPersists; virtual; // Calls read afterwards


procedure LoadExisting( TextIO : TTextIO );  // Loads without creating

and refactored, the errors disappeared and the recursion tests worked.

I believe this is a Compiler bug so I will post a bug report for fpc 
over the weekend.


Comments will be appreciated.

Don Ziesig


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


[Lazarus] Incompatibility: dynamic array and TStream

2016-02-23 Thread Donald Ziesig

Hi All:

I am trying to read the contents of a memory stream into a dynamic array 
of characters and the program keeps crashing when I try to free the 
dynamic array.


Really simple code:

  Buf : array of Char;
  Stream : TMemoryStream;
begin

// Initialize Stream here
  SetLength( Buf, Stream.Size );
// do nothing here
  SetLength( Buf, 0 ); // This works

  SetLength( Buf, Stream.Size );
  Stream.Read( Buf ); // or Stream.ReadBuffer( B, Stream.Size );
  SetLength( Buf, 0 ); // This crashes

end;

I've tried passing the Address of Buf, but the compiler doesn't like it.
Does anyone have any ideas how I can work around this?

Thanks,

Don Ziesig

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


Re: [Lazarus] Incompatibility: dynamic array and TStream

2016-02-23 Thread Donald Ziesig

On 02/23/2016 09:42 PM, Dmitry Boyarintsev wrote:
On Tue, Feb 23, 2016 at 9:39 PM, Donald Ziesig <don...@ziesig.org 
<mailto:don...@ziesig.org>> wrote:


I am trying to read the contents of a memory stream into a dynamic
array of characters and the program keeps crashing when I try to
free the dynamic array.

Only one line is wrong, do the following:

Stream.Read(Buf[0], Stream.Size);


thanks,
Dmitry



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Thanks, Dmitry.  I'll try that tomorrow morning.  It's getting late and 
I've been working for 14 hours so far. ;-)


I'll let you know then.

Thanks,

Don
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Lazarus on my ancient computer?

2016-02-26 Thread Donald Ziesig

On 02/26/2016 09:26 AM, Bart wrote:

Hi,

On 2/14/16, Bart  wrote:


This is a bit off-topic.

I have an ancient computer: Intel Celeron 700Mhz, 512MB RAM, 20GB IDE HD.
(http://flyingsheep.nl/computer_nostalgie.htm#celeron700)
(Hardware upgrades are not in the picture.)


Thanks to all for the give advice.
In the end I have installed Debian 8.3.0 XFCE on my geriatric system.
(I tested some other systems, but their installers just froze.)

It's up and running.
It feels rather slower than Suse 10.0 though.

I managed to install fpc 3.0 (from install script, did not install from .deb)
I managed to build Lazarus from svn.
That took some 30 minutes, and at one time I thought the system had
frozen, but it was just the linker taking ages (and probably being
very memory hungry).
I dealt with the infamous "crti.o not found" message.

As we speak I'm typing this in Iceweasel!

Bye for now.

Bart

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



Hi Bart,

Congrats on getting the old-timer to work.

Also congrats on getting rid of the crti.o message.  I have been 
ignoring those messages for years because they don't seem to do anything 
bad, but I sure would like to get rid of them.  How did you do it?


Thanks,

Don Ziesig

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


Re: [Lazarus] Get Lazarus January 2016 Update

2016-01-21 Thread Donald Ziesig

HI Anthony,

You recently replied to Sandro:

If you're using my bundles and you want more packages, just use the 
"Packages > Install/Uninstall Packages" menu item, choose any of the 
packages you want, then click "Save and rebuild IDE".


I had not used those steps before so I tried, using the "Packages > 
Install/Uninstall Packages" menu item, selected my existing package and 
click "Save and rebuild IDE".  The Messages box immediately (it doesn't 
look like it tried to do anything) is populated with "Panic *** make No 
rule to make target 'idepkg' Stop"


When I load the package dialog for my component library and click on Use 
> Install it asks if I want to rebuild the Ide.  I click Yes and it 
reports the exact same error.


Just out of curiosity, where (path and name) is the makefile for 
building the ide so I can investigate this problem on my own?


I did try make clean bigide and make bigide and the response was that it 
could not find target 'clean' or target 'bigide'.


Thanks,

Don Ziesig



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


Re: [Lazarus] Get Lazarus January 2016 Update

2016-01-21 Thread Donald Ziesig

On 01/21/2016 04:34 PM, Anthony Walter wrote:

Okay Don, that's a valid problem.

I'll look into it and reissue a new bundle for the Pi. I may have been 
overzealous in removing files from the lazarus folder to squeeze down 
the size. I'll message you when it's fixed and tested. You'll just 
need to rerun the setup script and give it the same folder name. The 
setup will overwrite the entire old copy.


If you ever want to uninstall, just use "rm -rf " where 
 was your chosen install location. Nothing aside from one 
optional desktop launcher file (optionally in 
$HOME/.local/share/applications/lazarus.desktop) is written outside 
that folder.



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Great!  I had already figured out the rm -rf to remove the new 
installation.


I understand about the SD squeeze.  I ran into that problem at the 
beginning, too.  SD cards are so cheap that I bought a 16 GB card, 
copied the 8 GB noobs SD to it then resized the partitions.  I now have 
over 12 GB free on /home. :-)


Before I tried installing the old components I tried to set up lazarus 
so it would run as root (the PI I am working on will never be connected 
to the net once lazarus is setup, and it needs to be root to debug 
digital IO).  It worked the first time, but after a reboot it kept 
complaining about not finding system.ppu even though system.ppu was 
where it was supposed to be.  It also suggested that I look at fpc.cfg 
(which did not change either).  Just to be sure, I did the rm -rf and 
re-ran setup.sh.  I had 1.4.4 working by calling startlazarus via sudo, 
but that route doesn't seem to be available anymore.  I did audit file 
ownership and protections but they seemed correct.  Any ideas?


Thanks for the excellent work.

Don



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


Re: [Lazarus] Get Lazarus January 2016 Update

2016-01-21 Thread Donald Ziesig

On 01/21/2016 04:37 PM, Mattias Gaertner wrote:

On Thu, 21 Jan 2016 15:32:39 -0500
Donald Ziesig <don...@ziesig.org> wrote:


[...]
I did try make clean bigide and make bigide and the response was that it
could not find target 'clean' or target 'bigide'.

What platform?

You need to change to the lazarus directory before calling make.

Mattias

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



Mattias,

Platform Raspberry PI.

directory ~/Development/FreePascal/lazarus

Don


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


[Lazarus] Raspberry PI, minor glitch.

2016-01-23 Thread Donald Ziesig

Hi Anthony (and everyone else):

I ran into a minor glitch (I saw this before, but it went away with your 
latest fix).  I don't know exactly why it went from working to not 
working, but I found out what it was doing wrong.


Lazarus was working fine through multiple re-boots, running as root and 
debugging code using h2wiringPi.  The entire system hung when I went to 
do something on the Main Menu (the Raspbian one) so I had to power down 
(pull the plug) and reboot.  When it came back this time, I started 
Lazarus and it complained about not being able to access *ppcarm* 
because it couldn't find *system.ppu* and please check*fpc.cfg*.  When 
this happened before, I found *system.ppu* where it belonged and 
*fpc.cfg* hadn't changed either).  After a bit of debugging (hacking, 
really), I found that it had changed to using*fpc-2.6.4*.  I don't know 
why but *which ppcarm* showed */usr/bin/ppcarm* which was linked to 
*2.6.4* (as was*/usr/bin/fpc*).  I changed the links to point to 
*/home//Development/FreePascal/fpc/bin/ppcarm* and Lazarus 
started working correctly again.


I had uninstalled *2.6.4* using *apt-get remove,* but that doesn't seem 
to have finished the job (manual *rm -rf* killed it for good).


I don't know what caused it to change to */usr/bin/fpc* and 
*/usr/bin/ppcarm*, but now that they are linked to the Development 
version (and *2.6.4 *is totally gone) everything is working again.


Don Ziesig
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Raspberry Pi Debug Digital I/O

2016-01-24 Thread Donald Ziesig

On 01/24/2016 05:47 AM, Bo Berglund wrote:

On Fri, 22 Jan 2016 20:55:59 -0500, Donald Ziesig <don...@ziesig.org>
wrote:


The application itself must run as root to do digital I/O.  If you don't
want to debug using the IDE, you don't have to make the IDE run as root,
though, just the app.

I do not think this is necessary!

I am NOT running my RPi2B as any other user than pi and it works just
fine to access the GPIO pins. Both FPC and Lazarus run just fine as pi
user.

The trick is to make sure that pi belongs to the proper groups dealing
with the hardware. You can check this using the command:
cat /etc/group | grep pi

It will list the groups pi belongs to and you will find out if there
are missing groups here. This is what my Pi says:

pi@rpi2-jessie2:~/dev $ cat /etc/group | grep pi
adm:x:4:pi
dialout:x:20:pi
cdrom:x:24:pi
sudo:x:27:pi
audio:x:29:pi
video:x:44:pi
plugdev:x:46:pi
games:x:60:pi
users:x:100:pi
input:x:101:pi
netdev:x:108:pi
spi:x:999:pi
i2c:x:998:pi
gpio:x:997:pi  <== This for GPIO

Hi Bo,

I get exactly this on my pi except there is a line:

pi:x:1000:

immediately following the netdev line..


I never use the NOOBS disk, I always create the start image from the
offiocial Raspbian Jessie image, currently I am on the Nov 2015
release. And the groups above were set from the start on that distro.


I updated the copy of NOOBS to use jessie as soon as jessie was available.
I updated FPC and Lazarus from Anthony's download (as he corrected it 
for the problem with installing custom components) as soon as it was 
available.


When I run my program unprivileged from the command line I get:

wiringPiSetup:  Must be root.  (did you forget sudo?).

Using the same executable but prefacing the command with sudo, it runs 
and does digital I/O.


When I try to run my program using unprivileged Lazarus it compiles but 
the Debugger crashes.


When I run my program using root-mode Lazarus it compiles, runs and does 
digital I/O.


The comments in h2WiringPi state that the programs that use it must run 
as root, which is how I got to this position in the first place.


Don




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


Re: [Lazarus] Get Lazarus January 2016 Update

2016-01-22 Thread Donald Ziesig

On 01/22/2016 03:51 AM, Anthony Walter wrote:
Okay Don a new Pi bundle has been uploaded which fixes the rebuild IDE 
problem you experienced. Just run setup.sh again to update.



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

IT WORKS!

I haven't re-installed the component that uses RegExpr in the package 
yet, but what I have is sufficient for this project so far.


Now all I need is to get the IDE/debugger to run as root so I can debug 
the Pi's hardware I/O software.


Will keep you posted.

Many thanks,

Don
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Lazarus January 2016 Update Can't install custom components.

2016-01-21 Thread Donald Ziesig

On 01/20/2016 04:53 PM, Anthony Walter wrote:
I've posted new installer for Free Pascal and Lazarus at 
getlazarus.org . Here is an overview of the 
what's new:


Video:

http://www.getlazarus.org/new/

Changes include:

A new Lazarus layout with the component pallet removed and coolbar 
buttons in its place. The a docked form designer is now the default 
form editor.


The new menu editor is included along with my application explorer 
tool. The source to the application explorer is in the components 
folder and might be of interest to users wanting to try their hand at 
extending the IDE,


The new documentation site at docs.getlazarus.org 
 is now the F1 help site.


Minimal FPC 3.0.0 compilers with friendly setup scripts are now 
available at http://www.getlazarus.org/setup/minimal/. I've also 
updated the "making it yourself" page with better instructions.


Finally FPC 3.1.1 trunk includes support for generic 
functions/procedures, which are quite nice.



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

Hi Anthony,

I just tried to use the new Lazarus for Raspberry PI and ran into two 
problems trying to add components from a four-year-old library (that has 
been working on Linux for that time and on Raspbian up to Lazarus 1.4).


This version of fpc/lazarus does not have the RegExpr package so one of 
my components failed to compile.  I removed it from the package and 
started over (I don't need it for the app on the PI so for now this is 
not a major issue.  I do need it on Linux so now I am hesitant to 
upgrade my main development machine.).


The big problem occurred when rebuilding lazarus to install the new 
components:


Build IDE Exit Code 512 Errors 4
Panic *** make No rule to make 'idepkg'  Stop.

remaining errors are leaving directory and make terminated.

Is there a work-around for this (besides returning to 1.4)?  I need 
several of the components in this library.


Thanks,

Don Ziesig
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Raspberry Pi Debug Digital I/O

2016-01-22 Thread Donald Ziesig

Hi All!

This applies to the Raspberry Pi 2 B.

After a bit of cut and try, I got Anthony Walter's version of Lazarus to 
run as root (from the Raspbian menu) so I could debug programs which do 
DigitalRead, DigitalWrite, etc. using h2wiringPi.


Note that this could be dangerous if you are permanently connected to 
the web while using Lazarus, but in my case, the only time that my Pi 
will be connected to the web is when I am getting Lazarus set up (and it 
is not yet running as root).  Thereafter I will be connected directly 
from Pi to Laptop on a private subnet with no router.  Once the app is 
developed the Pi will not be networked at all.


Incidentally, I got the Pi setup so that if it fails DHCP (is not 
connected to a router) it reverts to the private subnet.  If anyone 
wants to do this, let me know and I'll publish the "magic incantations". 
;-) It is much more convenient than editing /etc/network/interfaces 
every time you need to change from accessing the web to a local private 
subnet.


The application itself must run as root to do digital I/O.  If you don't 
want to debug using the IDE, you don't have to make the IDE run as root, 
though, just the app.


Using Anthony's default paths, I created a file in 
/home//Development/FreePascal/lazarus called lazroot.sh  This 
file contains two lines:


xhost +localhost
sudo /home//Development/FreePascal/lazarus/lazarus.sh

Then chmod +x lazroot.sh

I used the Menu > Preferences > Main Menu Editor to change the command 
which starts Lazarus to:


/home//Development/FreePascal/lazarus/lazroot.sh

Obviously  is the directory where lazarus is located.

At first I tried to change the Menu command to the two lines in the 
lazroot.sh file, but the internals of the menu system did not support 
multi-command arguments.


For some reason, Lazarus re-built itself (as if I were installing 
components) the very first time I ran it as root.  After that it starts 
normally.


Hope this helps someone in return for all the help I have been given here.

Don Ziesig



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


[Lazarus] Library dependency problem. Help please!

2016-02-11 Thread Donald Ziesig

Hi All!

I am having a strange library dependency problem.  It started yesterday 
afternoon in a set of code very far from where I was working at the 
time.  I have tried everything I can think of (including creating a new 
dummy project,  and rebuilding and renaming both libraries, one file at 
a time).


The problem appears to be associated with a generic type definition.  
When I remove the specialization for that generic and comment out the 
dependent code, the problem goes away (of course the program no longer 
works, but at least it compiles).


I have two packages:  AppLibrary which contains application-specific 
units that will be used in several related projects, and; CommonLibrary 
which contains general-purpose units that I have used for years (some go 
back to Delphi 2).  AppLibrary requires CommonLibrary.   The generic 
type definition is in the common library, the specialization is in the 
app library.


CommonLibrary compiles successfully.  AppLibrary (original version and 
all copies I have made for debugging this issue) fails to compile if it 
has a particular specialize clause in the interfaces section of any of 
its units (most of which have been working for the past month).  I have 
tried all of the units one at a time and any one with this specialize 
clause included fails compilation the exact same way:


During compilation a dialog box appears with the caption "File Not 
Found".  The directory it is looking for is the original path from the 
original app from yesterday.  The path is associated with the AppLibrary 
and the persistslist2.pas file is in the directory associated with the 
CommonLibrary.


/home/pi/Module14Code/Common/persistslist2.pas

The path exists but the file does not (the file is in the appropriate 
directory for the library).


I tried creating a totally new project and as I said above, new 
libraries in a new directory tree.  When I try to compile the AppLibrary 
I still get the error with the old path.  I tried renaming the 
persistslist2 unit to persitslist3 (which only exists in the test 
version of the CommonLibrary).  The same error occurs but now it wants 
the old path with the new file:


/home/pi/Module14Code/Common/persistslist3.pas

I have tried greping for the path and it only appears in files 
associated with the pre-problem application.  Is it possible that 
something associated with the compiler's configuration file(s) is 
remembering the old stuff?  This error has persisted through multiple 
reboots.


I am using Raspbian Jessie with Lazarus 1.7 (no changes here since early 
January).  It worked properly using Lazarus 1.4.2 before then.  I have 
rebuilt Lazarus in an attempt to fix the problem, but it made no 
noticable change.


One thing that would be useful is if the "File Not Found" dialog would 
reference the offending file and perhaps the source of the text of the 
path.  I wasted a lot of time removing units from AppLibrary 
one-at-a-time before I could identify the failing ones.


Any help will be greatly appreciated.

Thanks,

Don Ziesig


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


Re: [Lazarus] How to recover from Fatal: Invalid PPU-File entry 121

2016-03-19 Thread Donald Ziesig

On 03/19/2016 06:27 PM, Donald Ziesig wrote:

Hi All!

I've been happily coding away all day on my Raspberry Pi 2B+, when all 
at once I got the error:


Compile package LCL 1.7 : Exit code 256, Errors 1
Fatal: Invalid PPU-File entry 121

I tried rebuilding using Run | Clean up and Build, but got the same 
error (after a few minutes of compiling, assembling, ... ).


The error message is rather cryptic for a user as opposed to a 
developer.  What is PPU-File entry 121?


I am going to try shutdown and restart after I send this email. (Works 
for Windows, so... :-D )


Well, looks like it works for Raspbian as well as Windows. Shutdown, 
power off, reboot and rebuild ran to completion and I can now go back to 
happily coding :-) .  I wonder if we will have to do this if our Google 
Cars stop running.


I'm using:

Lazarus 1.7 dated 01-22-2016
FPC 3.0.0
SVN 51308

The OS is the latest version of raspbian as of the end of January.


Any advice (well almost any advice ;-) ) will be appreciated.

Thanks,

Don Ziesig

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





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


[Lazarus] How to recover from Fatal: Invalid PPU-File entry 121

2016-03-19 Thread Donald Ziesig

Hi All!

I've been happily coding away all day on my Raspberry Pi 2B+, when all 
at once I got the error:


Compile package LCL 1.7 : Exit code 256, Errors 1
Fatal: Invalid PPU-File entry 121

I tried rebuilding using Run | Clean up and Build, but got the same 
error (after a few minutes of compiling, assembling, ... ).


The error message is rather cryptic for a user as opposed to a 
developer.  What is PPU-File entry 121?


I am going to try shutdown and restart after I send this email. (Works 
for Windows, so... :-D )


I'm using:

Lazarus 1.7 dated 01-22-2016
FPC 3.0.0
SVN 51308

The OS is the latest version of raspbian as of the end of January.


Any advice (well almost any advice ;-) ) will be appreciated.

Thanks,

Don Ziesig

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


Re: [Lazarus] Edit Shortcut Bug when Defining Generic Record

2016-03-06 Thread Donald Ziesig

On 03/06/2016 02:17 PM, Mazola Winstrol wrote:

Hello,

Lazarus version: 1.6 using the lazarus provided fpc compiler (3.0).


Please confirm if it is a bug:

If i define a generic record, when i press Ctrl+Shift+C to 
automatically define the implementation, the code generated ignores 
the type parameter.



=== CODE ===

unit Test;

interface

type
  TMyRecord = record
procedure TestIfCompiles;
  end;


implementation


// CODE GENERATED WITH Ctrl+Shift+C

procedure TMyRecord.TestIfCompiles;
// Should be TMyRecord.TestIfCompiles;
begin

end;

end,

 END 


Best reagds




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

Hi Mazola,

It happens to me, as well.  I posted a bug report on it a while back, 
but haven't seen any response to it yet.


Don
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] cthread library for fpc 3.0 on raspberry pi. - SOLVED

2016-05-21 Thread Donald Ziesig

On 05/20/2016 06:04 PM, Donald Ziesig wrote:

Hi All!

I'm still trying to play audio on my Raspberry Pi B 2 using FPC 3.0 
and Lazarus 1.7 using UOS.


After help from Graeme and Mattias, (many thanks) I was able to get 
UOS to compile, but when I try to run the demo programs I get Runtime 
Error 232.  This implies that I do not have the appropriate cthread 
library installed on the Pi.  Can anyone tell me what file(s) I need 
and where to get them?


I am able to compile and run the demos on my Linux Mint 17.2 laptop.

Thanks,

Don Ziesig

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


It took a while, but I finally figured out how to get the audio to play 
on my Raspberry Pi using UOS.


I never did notice that the "cthread," line in the demo's lpr file was 
grayed out.  This meant that the conditional compilation directives were 
eliminating that line from the code.   Simply adding the line {$define 
UseCThreads} into the define.inc file caused the execution to succeed 
and play sounds.,


I am not sure why this was defined by default on my Laptop and not on 
the Pi, but that is all that was wrong.


Thanks again for the help.  Now I am off to work fixing the target app 
by rewriting the PlayAudio object to use UOS rather than omxplayer.


Don Ziesig

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


[Lazarus] cthread library for fpc 3.0 on raspberry pi.

2016-05-20 Thread Donald Ziesig

Hi All!

I'm still trying to play audio on my Raspberry Pi B 2 using FPC 3.0 and 
Lazarus 1.7 using UOS.


After help from Graeme and Mattias, (many thanks) I was able to get UOS 
to compile, but when I try to run the demo programs I get Runtime Error 
232.  This implies that I do not have the appropriate cthread library 
installed on the Pi.  Can anyone tell me what file(s) I need and where 
to get them?


I am able to compile and run the demos on my Linux Mint 17.2 laptop.

Thanks,

Don Ziesig

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


[Lazarus] How to play audio from memory.

2016-05-11 Thread Donald Ziesig

Hi All!

Is there any Free Pascal code that can play audio directly from memory?

I would like to be able to play the equivalent of a .WAV file through 
the stereo output jack of a Raspberry Pi.


Currently I am able to do this by calling omxplayer with a file name and 
volume information.  Unfortunately, the latency between starting 
omxplayer and the beginning of the audio output is several seconds which 
is unacceptable for my application.  I can't determine whether the 
latency comes from loading omxplayer's executable or reading the audio 
file, or both, but if I could have the code as part of the fpc 
executable and the audio data already in memory, I believe the latency 
will be as low as possible.


Any suggestions will be appreciated.

Don Ziesig

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


Re: [Lazarus] How to play audio from memory.

2016-05-16 Thread Donald Ziesig

On 05/11/2016 05:26 PM, Graeme Geldenhuys wrote:

On 2016-05-11 21:53, Donald Ziesig wrote:

Currently I am able to do this by calling omxplayer with a file name and
volume information.  Unfortunately, the latency between starting
omxplayer and the beginning of the audio output is several seconds

Yes, it’s possible with the United OpenLib of Sound (UOS). Fred has
created an excellent library and it works very well. I’ve personally
tested it on multiple platforms, and so too have others. The latency is
very low when used with LCL, and even lower when used with fpGUI.

You can find the code here:
https://github.com/fredvs/uos/

It includes a couple of example applications too.

There has been quite a few discussions of UOS with Fred in the Lazarus
Forums too.

Regards,
   Graeme

Thanks Graeme!  It works great on my laptop.  Now I need to port it to 
the Raspberry Pi.


Unfortunately, the version I have on the Pi doesn't have the units for 
openssl and fpopenssl.


Since I will not need the ssl functionality, I am trying to track down 
the code tree that references those units.  Do you know if Lazarus has a 
way to show the units used when a compilation fails?


Thanks again.

Don Ziesig


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