Re: [fpc-pascal] Error: Argument cannot be assigned to

2023-06-04 Thread Juha Manninen via fpc-pascal
OK, I understand mostly. Thanks.

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


Re: [fpc-pascal] Error: Argument cannot be assigned to

2023-06-04 Thread Juha Manninen via fpc-pascal
On Sunday, June 4, 2023, Mattias Gaertner via fpc-pascal <
fpc-pascal@lists.freepascal.org> wrote:

>
> Correct. Property RecInstance is read only.
>

No, I can define it as :
property RecInstance: TMyRec read fRecInstance write fRecInstance;
and still get the same error.

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


Re: [fpc-pascal] Error: Argument cannot be assigned to

2023-06-04 Thread Juha Manninen via fpc-pascal
Formatting was a little weird. This is what I meant, but the error remains :

type
  TMyRec = record
ss: String;
ii: Integer;
  end;
  TMyClass = class
  private
fName: String;
fRecInstance: TMyRec;
  public
property RecInstance: TMyRec read fRecInstance;// write fRecInstance;
  end;
var
  MyObj : TMyClass;
begin
  MyObj := TMyClass.Create;
  MyObj.RecInstance.ii := 123;
  MyObj.Free;
end.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Error: Argument cannot be assigned to

2023-06-04 Thread Juha Manninen via fpc-pascal
Compiler version is FPC 3.2.2 on Linux.

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


[fpc-pascal] Error: Argument cannot be assigned to

2023-06-04 Thread Juha Manninen via fpc-pascal
Why the following code fails to compile?

type
  TMyRec = record
ss: String;
ii: Integer;
  end;
  TMyClass = class
  private
fName: String;
fRecInstance: TMyRec;
  property
RecInstance: TMyRec read fRecInstance;// write fRecInstance;
  end;
var
  MyObj : TMyClass;
begin
  MyObj := TMyClass.Create;
  MyObj.RecInstance.ii := 123;
  MyObj.Free;
end.

Access through property seems to be the problem. Accessing fRecInstance
directly works.

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


Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-09 Thread Juha Manninen via fpc-pascal
On Wed, Sep 9, 2020 at 11:40 AM Bart via fpc-pascal <
fpc-pascal@lists.freepascal.org> wrote:
> This is a bit counter intuitive to me.

It is explained here:
 https://wiki.freepascal.org/Unicode_Support_in_Lazarus

For LacaK I recommend using UTF-8 encoding as much as possible. Then
everything "*just works*".
You could have a unit or .inc file with WinCP constants for Delphi7, and
then some IFDEFs. They should be explicitly converted to UTF-8 for LCL.
UnicodeString constants can also be a good solution. It triggers an
automatic conversion when assigned to a String variable. The conversion is
usually fast enough.

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


Re: [fpc-pascal] Wine + Unsupported ioctl

2020-04-04 Thread Juha Manninen via fpc-pascal
On Sat, Apr 4, 2020 at 10:13 PM Juha Manninen 
wrote:

> Lazarus source dir is a symlink to my current sources. It should AFAIK. (?)
>

Should be: "It should work as far as I know."
My brain capacity is getting low after some bug fixing etc.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Wine + Unsupported ioctl

2020-04-04 Thread Juha Manninen via fpc-pascal
On Sat, Apr 4, 2020 at 8:43 PM Alexander Grotewohl  wrote:

> my guess is that function of wine is unimplemented (pretends to work but
> does nothing)
> try to see if you can fix the cause of the second error? does wine handle
> relative paths gracefully?
>

Ok, the fatal error was the "Path "..\" does not exist" instead of
"Unsupported ioctl".
Yes, wine handles relative paths for sure. I don't what could cause such an
error.


On Sat, Apr 4, 2020 at 9:42 PM fredvs via fpc-pascal <
fpc-pascal@lists.freepascal.org> wrote:

> Here on Linux Dedian 10.2 64 bit multi-arch it is working perfectly.
> I use wine + fpc.exe to compile many project, included MSEide or ideU.
>
> Where did you install fpc.exe, in .wine/drive_ ?
> Did you install the Lazarus source also in .wine/drive_c ?
>

FPC is in drive_c/FPC. I just started the 3.2RC1 installer from Dolphin and
it ran with Wine. Nice.
Lazarus source dir is a symlink to my current sources. It should AFAIK. (?)
$ ls -la drive_c/
yhteensä 32
drwxr-xr-x  8 juha juha 4096  4. 4. 19:45  .
drwxr-xr-x  4 juha juha 4096  4. 4. 21:36  ..
drwxr-xr-x  3 juha juha 4096  4. 4. 19:37  FPC
lrwxrwxrwx  1 juha juha   28  4. 4. 19:45  lazarus_trunk ->
/home/juha/SW/lazarus_trunk/
drwxr-xr-x  7 juha juha 4096 29. 3. 02:04  ProgramData
drwxr-xr-x  7 juha juha 4096 29. 3. 02:04 'Program Files'
drwxr-xr-x  8 juha juha 4096 29. 3. 02:04 'Program Files (x86)'
drwxr-xr-x  4 juha juha 4096 29. 3. 00:56  users
drwxr-xr-x 20 juha juha 4096  4. 4. 21:36  windows


What command line are you using, I use this?
>
> wine /home/fred/.wine/drive_c/FPC/3.0.4/bin/i386-win32/ppc386.exe
> myprogram.pas
>

 wine cmd
 cd lazarus_trunk
 make bigide

All packages were built correctly before the error.

BTW, I installed Wine stable 5.0-2 from Manjaro AUR but got the exact same
errors.
Installing from AUR was impressive. It compiled with GCC for over half an
hour with all 8 cores at 100% load. Then it just worked...
I have a new passively cooled miniPC super-computer (!) with Ryzen 1605B
embedded processor.
I used the opportunity to measure its thermal design. This was the hottest
it got after ~half an hour:
-Sensors-
../../nvme0/temp1 Temperature 71,00°C
k10temp/temp1 Temperature 86,88°C
k10temp/temp2 Temperature 86,88°C
../../thermal_zone0/temp1 Temperature 66,00°C
amdgpu/temp1 Temperature 86,00°C
thermal/thermal_zone0 Temperature 67,00°C

Within the limits, no throttling. Nice! That was about the heaviest load it
will get.

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


[fpc-pascal] Wine + Unsupported ioctl

2020-04-04 Thread Juha Manninen via fpc-pascal
Hello

I installed FPC 3.2RC1 Win32 version under Wine in Linux Manjaro 64-bit.
Wine version is a recent 5.5-1.
Compiling a hello.lpr program works.
Then I made a symbolic link for my Lazarus trunk sources and tried to build
with both "make all" and "make bigide".
All components compile well but with lazbuild it stops with an error (see
below).
What does "008b:fixme:ntdll:server_ioctl_file Unsupported ioctl" mean?
A net search gave only few links and they told to ignore the message if the
program works.
Well, this does not work.
Has anybody built Lazarus under Wine? Should I test with FPC 3.0.4? Is this
somehow related to the new version? Or is it about 32 / 64 bits?
I remember building Lazarus under Wine some years ago but then I installed
from Lazarus installer and later created a symlink for trunk sources.

Juha

---

make[1]: Leaving directory `c:/lazarus_trunk/components/lazdebuggergdbmi'
make -C ide lazbuilder LCL_PLATFORM=nogui
make[1]: Entering directory `c:/lazarus_trunk/ide'
make --assume-new=lazbuild.lpr lazbuild.exe OPT='
-Fu../packager/units/i386-win32 -Fu../components/codetools/units/i386-win32
-Fu../components/debuggerintf/lib/i386-win32
-Fu../components/lazutils/lib/i386-win32 -Fu../lcl/units/i386-win32
-Fu../lcl/units/i386-win32/nogui
-Fu../components/buildintf/units/i386-win32
-Fu../components/ideintf/units/i386-win32/nogui
-Fu../components/synedit/units/i386-win32/nogui
-Fu../components/lazcontrols/lib/i386-win32/nogui
-Fu../components/lazdebuggergdbmi/units/i386-win32/nogui
-Fu../units/i386-win32/nogui '
make[2]: Entering directory `c:/lazarus_trunk/ide'
c:/FPC/3.2.0rc1/bin/i386-Win32/ppc386.exe -gl -vbqewnhi -Sci -dlclnogui
-Fu../designer -Fu../debugger -Fu../debugger/frames -Fu../converter
-Fu../packager -Fu../packager/frames -Fu../components/custom -Fuinclude/win
-Fuframes -Fu. -Fiinclude -Fiinclude/win32 -Fi../images -FE..
-FU../units/i386-win32/nogui -Fu../packager/units/i386-win32
-Fu../components/codetools/units/i386-win32
-Fu../components/debuggerintf/lib/i386-win32
-Fu../components/lazutils/lib/i386-win32 -Fu../lcl/units/i386-win32
-Fu../lcl/units/i386-win32/nogui
-Fu../components/buildintf/units/i386-win32
-Fu../components/ideintf/units/i386-win32/nogui
-Fu../components/synedit/units/i386-win32/nogui
-Fu../components/lazcontrols/lib/i386-win32/nogui
-Fu../components/lazdebuggergdbmi/units/i386-win32/nogui
-Fu../units/i386-win32/nogui -di386 lazbuild.lpr
Hint: (11030) Start of reading config file
c:\FPC\3.2.0rc1\bin\i386-Win32\fpc.cfg
Hint: (11031) End of reading config file
c:\FPC\3.2.0rc1\bin\i386-Win32\fpc.cfg
Free Pascal Compiler version 3.2.0rc1 [2020/02/29] for i386
Copyright (c) 1993-2020 by Florian Klaempfl and others
008b:fixme:ntdll:server_ioctl_file Unsupported ioctl 900a8 (device=9
access=0 func=2a method=0)
Error: (1017) Path "..\" does not exist
make[2]: *** [lazbuild.exe] Error 1
make[2]: Leaving directory `c:/lazarus_trunk/ide'
make[1]: *** [lazbuilder] Error 2
make[1]: Leaving directory `c:/lazarus_trunk/ide'
make: *** [lazbuild] Error 2
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Will moving from due core CPU to 6 Core CPU of the same clock speed improve the speed of FPC compiling?

2018-10-16 Thread Juha Manninen
Computers have been fast enough for many years already, except for the
latest 3-D games and some special tasks maybe.
I have used an AsRock BeeBox TV-box with a passively cooled Celeron
N3000 mobile CPU for few years now as my main computer. It still feels
fast! I bet the dual port RAM and SSDs help with that, although the
CPU is slow in today's standards.
Only Windows 10 running under VirtualBox is slow but I don't need to
start it often.

The new models of Celeron mobile CPUs are already much faster and
there are similar gadgets using them. Highly recommended!

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

Re: [fpc-pascal] Advanced note: local variable "i" is assigned but never used?

2018-02-20 Thread Juha Manninen
Try with flag -OoDFA

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

Re: [fpc-pascal] re-engineering tool

2018-01-08 Thread Juha Manninen
On Sat, Jan 6, 2018 at 11:46 AM, Marc Santhoff  wrote:
> Since I'm confronted with the task of analyzing a pile of object pascal
> sources I'd like to know:
>
> Is there any tool that can help me?
>
> Automatically generating a visual class diagram having uses and
> aggregation of other classes would be very helpful.

There is also a Lazarus port of Ess-Model called Laz-Model.
See:
 https://github.com/dicepd/Laz-Model
It is indeed a reverse-engineering class diagram tool.

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

Re: [fpc-pascal] How is EntryInformation.OS.haltproc assigned?

2017-12-09 Thread Juha Manninen
On Tue, Dec 5, 2017 at 7:28 PM, Victor Campillo
 wrote:
> I don't know if you have only the problem with Manjaro Linux, but in case it
> helps I just made a few test building a few Qt LCL examples with Lazarus
> Trunk + FPC trunk in Xubuntu 64-bit and does not get any access violation.

Thanks for testing.
It looks like nobody has the exact same problem.
There is a report about different crashes with QT:
  https://bugs.freepascal.org/view.php?id=29409
It happens only sometimes in some computers.

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

[fpc-pascal] How is EntryInformation.OS.haltproc assigned?

2017-12-04 Thread Juha Manninen
I am testing with a 64-bit Manjaro Linux.
I get an access violation when closing any LCL application built with
QT bindings using FPC trunk. When using FPC 3.0.2 there was no access
violation, and neither with other widgetsets. Only FPC trunk + QT
posed a problem.
I remember seeing this for some time, surely half a year, when testing
FPC trunk.
An app only says:
  An unhandled exception occurred at $7F180E69437C:
  EAccessViolation:
$7F180E69437C
Breakpoints inside the app did not reveal anything.

I wanted to find out what is happening and built FPC trunk with debug info.
The error happens in procedure System_exit in rtl/linux/system.pp, at line:
  EntryInformation.OS.haltproc(ExitCode);

Backtrace is not very useful:
 #0 SYSTEM_EXIT at system.pp:174
 #1 fpc_do_exit at ../inc/system.inc:1076
 #2 main at project1.lpr:20

In debugger the data in both records "EntryInformation" and
"EntryInformation.OS" look valid.
Apparently the haltproc is not assigned. Where should it be assigned?
The only place under rtl/linux I find haltproc assigned is in
"si_dll.inc". There procedure _FPC_shared_lib_haltproc deals with
shared libraries. Not relevant here.

After the crash I get an assembly window pointing to this line:
 760AE37C 660f6f442410   movdqa 0x10(%rsp),%xmm0
Isn't xmm0 a SSE2 register or something? I don't think the compiler
generated such code.

Amazingly enough the Lazarus IDE itself when built with QT bindings
does not crash at the end. Somehow the QT bindings are quilty but how?
Any clues where I should look for the problem?

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

Re: [fpc-pascal] FPC vs. Lazarus regarding some units...

2017-10-29 Thread Juha Manninen
On Sun, Oct 29, 2017 at 5:28 PM,   wrote:
> does the delphi conversion system convert those MMSystem calls
> to something else?

Now the converter just removes MMSystem from uses section.
I don't know how it should be converted. Maybe it should be left untouched.

> i remember seeing something about that back when i was trying to
> convert a delphi project several years ago... that brought some more changes
> and fixes to the delphi conversion process...

I don't remember details.
Anyway the unit names in uses section that are replaced / removed,
including MMSystem, can be configured by user.

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

Re: [fpc-pascal] FPC vs. Lazarus regarding some units...

2017-10-29 Thread Juha Manninen
On Sun, Oct 29, 2017 at 2:53 AM, Cleverson Casarin Uliana
 wrote:
> Why some units like the mentioned MMSystem are
> delivered with Lazarus but not with FPC?

MMSystem is not delivered with Lazarus. I don't know what you are writing about.

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

Re: [fpc-pascal] compiler option for $J directive

2017-10-10 Thread Juha Manninen
On Tue, Oct 10, 2017 at 9:33 AM,   wrote:
> Now a patch has been integrated for this , perhaps it could be added to
> Lazarus  Project Options | Compiler Options | Parsing

Patches are welcome also for that.
The option must be either hidden for compiler versions that do not
support it, or there must be a clear note / hint about it.

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

Re: [fpc-pascal] Usage of TFPCustomImage

2017-06-13 Thread Juha Manninen
On Tue, Jun 13, 2017 at 5:20 PM, Michael Van Canneyt
 wrote:
> However, this method of loading an image depends on the order of the uses
> statements: each registered reader is asked in turn whether it recognizes
> the stream.

The unit IntfGraphics in LCL does not have unit FPReadPNM in its uses clause.
It has: FPReadBMP,  FPReadPNG, FPReadTiff


> The first to answer 'yes' will be used to read the stream. If PNM 'falsely'
> recognizes a PNG stream as PNM, there is nothing you can do except tell the
> reader which format to use...

Ok, I don't know how to do that. I don't even know how TFPCustomImage
should be used without LCL + TLazIntfImage.
"Custom" in its name hints that a derived class should be used.
Somebody else can study what happens in the code.

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

[fpc-pascal] Usage of TFPCustomImage

2017-06-13 Thread Juha Manninen
The class TFPCustomImage and its usage has apparently changed in FPC
3.0.2 (and trunk) compared to FPC 3.0.

This issue:
  https://bugs.freepascal.org/view.php?id=32005
is marked for TLazIntfImage (in LCL) but actually the problematic
procedure LoadFromStream is in TFPCustomImage.
Please read my note in the issue.

Question: how should TFPCustomImage be used now?
I guess TLazIntfImage must be changed accordingly.

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

Re: [fpc-pascal] FPC clean room project

2017-01-07 Thread Juha Manninen
On Fri, Jan 6, 2017 at 6:41 PM, Michael Schnell  wrote:
> Can you use the toolkit plus fpc to compile and run Delphi Firemonkey
> application source code (after a decent amount of tweaking) ?

No.

You should continue a Firemonkey discussion in fpc-other list, as
Tomas Hajny suggested.

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


Re: [fpc-pascal] FPC 3.0.2 Release Date

2016-11-26 Thread Juha Manninen
FPC 3.0 was released exactly a year ago:
 http://forum.lazarus.freepascal.org/index.php/topic,30529.0.html
Over a year is a very long time for a bug fix release.
Will it happen this year? There is a month + few days left.

There was a documentation tool issue holding it back. It can be fixed
later. FPC 3.0.2 should be released ASAP.

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


Re: [fpc-pascal] Using for-loop index variable after loop

2016-10-10 Thread Juha Manninen
On Mon, Oct 10, 2016 at 3:07 PM, Vojtěch Čihák  wrote:
> Hi, if you mean this:
> ...

Yes, that is one of them.
The code does not make sense in any case, regardless of "i"'s value.
Index for cActionListEditorUnknownCategory and
cActionListEditorAllCategory differ.
"i" cannot have both at the same time. Maybe the condition should be
"or", not "and".
Why does it not compare Name directly with
cActionListEditorUnknownCategory and cActionListEditorAllCategory
constants?

There are many similar fishy code blocks. I will sanitize some of them ...

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

[fpc-pascal] Using for-loop index variable after loop

2016-10-10 Thread Juha Manninen
I have always avoided using a for-loop index variable after the loop.
I thought its value can be unpredictable in some situations when the
compiler reuses its register or memory etc.

I noticed the ActionListEditor in Lazarus sources has code that uses
it after the loop.
The compiler, FPC 3.0, does not warn about it.
I made a small test:

procedure MyProcedure;
var
  i: Integer;
begin
  for i := 0 to 5 do
WriteLn('iii ', i);
  Write('After loop i=', i);
  if i = 5 then
WriteLn(' as expected')
  else
WriteLn(' which is unpredictable');
end;

Indeed, no warning!
Is it OK to do that? Have I misunderstood it?

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


Re: [fpc-pascal] FPC sources in FreeBSD

2016-07-09 Thread Juha Manninen
On Sat, Jul 9, 2016 at 4:34 PM, Marc Santhoff  wrote:
> So you know about dot-names for hidden files and other basics. ;)

Yes sure.
Now I have apparently forgotten much of what I learned a long time
ago, although it comes back after some repetition.

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


Re: [fpc-pascal] FPC sources in FreeBSD

2016-07-09 Thread Juha Manninen
Thanks everybody for help and comments.
My memory is recovering slowly about keyboard configuration. It was
many years ago I did it manually for Linux distros.
But yes, "setxkbmap fi" in .xinitrc did the job.

I confused "pkg" and "ports". Must learn more about the topic.

I am quite happy with my current host OS, Manjaro Linux + KDE. Not
planning to change it.
BSD experiments are for general learning and for testing Lazarus trunk
with them.
For example this bug report can very likely be closed but I wanted to
check myself:
  http://bugs.freepascal.org/view.php?id=29077

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


[fpc-pascal] FPC sources in FreeBSD

2016-07-08 Thread Juha Manninen
Hello

I installed FreeBSD 10.3 under VirtualBox. This is the first time I
use FreeBSD. Cool!
I managed to install X, XFCE and all applications I need.
FPC and Lazarus both work.

Only thing missing now is FPC source code, needed by Lazarus.
Can it be installed from ports with "pkg" command?
I don't see sources in "pkg search fpc" output list.

BTW, the list starts like this:
 # pkg search fpc
 fpc-3.0.0 Free Pascal compiler with Turbo and Delphi
 ...

Funny :)

Another thing missing from my FreeBSD is proper keyboard mapping. It
behaves like US keyboard now.
I remember similar problems with Linux distros a _long_ time ago.
Anyway, this is not an FPC issue. I will find the configuration somewhere.

One more question:
Is installing OpenBSD much more difficult? I may try it, too.

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


Re: [fpc-pascal] Conditional code for FPC modes

2016-06-15 Thread Juha Manninen
More accurately, I want to check {$ModeSwitch UnicodeStrings}.
Anyway, if there is no define, I can use:

  {$IF SizeOf(Char) = 2}

Works well although the highlighter in Lazarus editor shows it wrong.

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


[fpc-pascal] Conditional code for FPC modes

2016-06-15 Thread Juha Manninen
Are there defines matching the modes in FPC, for example {$mode delphiunicode} ?
I want to do something like :
  {$IFDEF delphiunicode}
...
  {$ELSE}
...
  {$ENDIF}

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


Re: [fpc-pascal] FPC 3 regression: cannot use TStringList for UTF-8 data any more?

2016-04-04 Thread Juha Manninen
On Mon, Apr 4, 2016 at 12:52 PM, Graeme Geldenhuys
 wrote:
> This is the FPC mailing list. Not everybody here uses Lazarus or LCL, so
> making such a suggestion is wishful thinking. For example, your
> suggestion means nothing to me, I don't use LCL.

Yes, I should have mentioned that this feature does not require LCL.
It only requires LazUtils package and LazUTF8 unit in your uses
section.
It can be used in cmd line and server programs and I guess in fpGUI,
too, although I have not tested.
But yes, it requires Lazarus IDE because LazUtils is a Lazarus
package. At least you must create and compile the project using
Lazarus IDE.

Anyway, this UTF-8 mode does more that sets the default String encoding.
It also provides proper UTF-8 functions as backends for RTL's
Ansi...() string functions.
It also uses cwstring although it pulls in clib.
Then typical users' code is amazingly Delphi compatible despite the
different encoding, because code only seldom deals with individual
codepoints beyond 7-bit ASCII.

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


Re: [fpc-pascal] FPC 3 regression: cannot use TStringList for UTF-8 data any more?

2016-04-04 Thread Juha Manninen
On Mon, Apr 4, 2016 at 11:18 AM,   wrote:
> I use TStringList for UTF-8 strings. This is no longer possible, because
> automatic conversions cause question marks and data loss.

You are completely lost with this issue. The automatic conversion of
encodings is a big step forward.
Just use the new UTF-8 mode provided by Lazarus and remove all
explicit conversion functions.
  http://wiki.freepascal.org/Better_Unicode_Support_in_Lazarus

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


Re: [fpc-pascal] FPC 3: disabling automatic AnsiString codepage conversion

2016-04-04 Thread Juha Manninen
On Mon, Apr 4, 2016 at 11:36 AM,   wrote:
> Sorry, I was not able to come to that conclusion from the existing docs.

Your question was not about Lazarus but maybe you should read this:
  http://wiki.freepascal.org/Better_Unicode_Support_in_Lazarus
It works also without LCL.
The bottom line is: remove all explicit conversion functions.

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


Re: [fpc-pascal] cwstrings unit and UTF8Decode()

2016-03-25 Thread Juha Manninen
On Fri, Mar 25, 2016 at 7:14 PM, Bart  wrote:
> It's just a define to signal that all strings in LCL are UTF8 and when
> offered to RTL their codepage is CP_UTF8.

Not only in LCL. Package LazUtils / unit LazUTF8 can be used also without LCL.
  
http://wiki.freepascal.org/Better_Unicode_Support_in_Lazarus#Using_UTF-8_in_non_LCL_programs

It means that when Graeme finally switches to FPC 3.x and he uses
LazUTF8 in his code, he gets cwstring as an extra bonus.

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


Re: [fpc-pascal] IsValidIdent() with dots

2016-03-23 Thread Juha Manninen
On Wed, Mar 23, 2016 at 10:52 AM, Mattias Gaertner
 wrote:
> FPC 3.1.1 has

Ok, it cannot be used yet. I will make it conditional later. Thanks.

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


[fpc-pascal] IsValidIdent() with dots

2016-03-23 Thread Juha Manninen
Hi

Is there a function like IsValidIdent but accepting also dots (.),
as in name "TForm1.Action1Execute"?

While fixing a bug:
  http://bugs.freepascal.org/view.php?id=25954
I copied and modified IsValidIdent.
It was easy to do, sure, but I would prefer to reuse an existing
function especialy because this looks like a common use case.

Codetools has a suitable IsDottedIdentifier() but I need it in IDEIntf
code which must not depend on Codetools.

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


Re: [fpc-pascal] Lazarus Release 1.6

2016-02-20 Thread Juha Manninen
On Sun, Feb 21, 2016 at 2:28 AM, Philippe Lévi  wrote:
> I still do not understand the reason why the size is 10 times bigger after 
> rebuilding Lazarus ...

Open Tools -> Configure "Build Lazarus" ... dialog.
Select profile "Optimized IDE". You can also use -O3 optimization in
options. Then build again.

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

Re: [fpc-pascal] Please someone explain this to me

2016-02-10 Thread Juha Manninen
On Wed, Feb 10, 2016 at 4:09 PM, Sven Barth  wrote:
> What about include files included by other include files?

Ok, that is a nasty situation. I think it should be avoided.

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


Re: [fpc-pascal] FPC 3 inclusion for debian/ubuntu?

2015-12-14 Thread Juha Manninen
On Mon, Dec 14, 2015 at 2:33 PM, Xiangrong Fang  wrote:
> However, there is no MIPS build.  To build fpc executables for MIPS, I have
> to do cross-compiling?

FYI, apparently FPC works with MIPS through cross-compiling but
Lazarus does not, based on this:
 http://forum.lazarus.freepascal.org/index.php/topic,30500.msg194153.html
MIPS will be important in future. I may get a MIPS gadget myself for testing.

It would be nice to have a maintainer who builds FPC binaries for
MIPS. Who volunteers? Maybe you? :)

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


Re: [fpc-pascal] Implementing Factory Method with Pascal

2015-11-28 Thread Juha Manninen
On Sat, Nov 28, 2015 at 1:48 AM, Marcos Douglas  wrote:
> Another tip: Factories resolve some problems but there is a cost. The
> factory will creates your instance (object) but it know only one
> constructor, ie, the base class constructor.

No, the constructor must then be virtual.
Inheritance is OK if all public virtual methods can be defined in an
abstract base class. If works as an interface then (without
"interface" keyword).
It does not work when you need TDog.Bark but it would work with
abstract function TAnimal.Says: String, which is implemented as "
Return 'wuff' " for TDoc and " Return 'miou' " for TCat.

But yes, the other answers are better for more complex cases.

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


Re: [fpc-pascal] Implementing Factory Method with Pascal

2015-11-28 Thread Juha Manninen
On Sat, Nov 28, 2015 at 2:07 PM, Marcos Douglas  wrote:
> Even using virtual constructors, the factory will know only one
> signature to instantiate objects.

Yes and often that is enough.
A constructor is then part of the API. (Lets call it API now to avoid
confusion with the "interface" keyword.)

> Completing things is the source of complexity, ie, completing
> (abstract or virtual) methods. To complete methods in a sub class, you
> need to know how super class works and this violate the (first tier
> of) encapsulation.

Yes, if the super class does something useful by itself, then often
your class design is wrong.
My example was about an abstact base class that only provides an API,
the derived classes implement it. The concept is similar to an
interface definition, but often the implementation is more compact and
easier to read.
Interface can define only methods. An abstract base class can have
also variables and protected helper methods needed by the
implementation code.

We are partly talking about different things here. You and the articly
you linked advocate the "composition over inheritance" principle. Yes,
it is a good principle. I also advocate it, but I also say that using
abstract base classes for APIs is often a cleaner and easier way
compared to interface types.
Look at the Lazarus API defined in IDEIntf package. It uses abstract
base classes and works well.

Abstract base classes do not work in a multiple inheritance case. Then
an interface type must be used.
However it is very rarely needed when the "composition over
inheritance" principle is followed.

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


Re: [fpc-pascal] FPC Pestering Peacock (3.0.0) release

2015-11-27 Thread Juha Manninen
How to get ARM Linux version for Raspberry Pi?

BTW, you really should improve the download links.
Now a user can select his CPU / platform from here:
  http://www.freepascal.org/download.var
It looks good so far.
Then he selects eg. Intel/i386 - FreeBSD.
There is a top link for SourceForge which leads to project "Files"
section where the user must select his platform and the compiler
version (!) again.
Why? The link should lead to the right place instead.

Selecting one of the mirrors instead of SourceForge works better,
except that ARM Linux offers FPC 2.6.4.

Download link is important because it is the first impression for new
people trying FPC.
A louzy first impression affects for a long time.

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


[fpc-pascal] FPC 3.0 + MIPS Linux

2015-11-27 Thread Juha Manninen
According to this :
  http://forum.lazarus.freepascal.org/index.php/topic,30500.msg194271.html
FPC 3.0 MIPS version for Linux works through cross-compilation.
It is not mentioned in release notes. Android  + MIPS is mentioned.

I may buy a MIPS gadget later to see why Lazarus does not work.
I believe there will be more MIPS TV-box class computers in future.

Are there any news about FPC MIPS version that I should know about?

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


Re: [fpc-pascal] Screwed FPC installation in Xubuntu

2015-09-29 Thread Juha Manninen
On Tue, Sep 29, 2015 at 11:00 AM, Marco van de Voort  wrote:
> Did you install as root ?  The sh script iirc only installs fpc.cfg in
> global dirs as root and otherwise locally as ~/.fpc.cfg

Oops, I found the error. I had installed the 32-bit version of FPC 3RC1.
 "Free Pascal Compiler version 3.0.0rc1 [2015/08/20] for i386"
I should not tweak my OS when I am tired.

Interestingly the compiler ran although it didn't work well without
fpc.cfg, but "fpcmkcfg" did not run at all.
Bash told the file or directory does not exist while it certainly was
there. Even "which fpcmkcfg" showed its location.
Anyway, on a 64-bit Linux you cannot run all 32-bit programs like you
can on Windows.
Now I have installed the 64-bit version. I can see /etc/fpc.cfg and
everything works again. Happy end!

The Ubuntu package manager behavior remains a mystery. I thought the
system is clean of FPC packages but reinstalling them still created
broken links to /etc/alternative.
In this matter I must agree with Graeme, the package manager tried to
be too smart.

Otherwise Xubuntu is rock-solid. I used Manjaro for a while. It is
also very good and the package system is better than in Ubuntu.
However it is a rolling on-the-edge distro and I got problems, partly
because I experimented too much.
Also the KDE 5 Plasma was not stable enough yet.
I will return to Manjaro later but now I want to do something else
than tweak my OS.

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


[fpc-pascal] Screwed FPC installation in Xubuntu

2015-09-28 Thread Juha Manninen
I was able to get my Xubuntu 15.10 into a state where FPC doesn't work even
if I remove and install again from repo.
I tried installing FPC 3RC1 but then removed all traces of it.
At one point there were links to /etc/alternative created by the
Ubuntu package system. After removing everything and then installing FPC 3
using the sh script, there is no fpc.cfg generated. Why not?

Strangely I have earlier managed to install FPC 3RC1 without problems in
other systems. This is embarrassing. I was planning to use Xubuntu for
a while now.

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

Re: [fpc-pascal] which GUI (noob)

2015-08-05 Thread Juha Manninen
On Wed, Aug 5, 2015 at 2:02 AM, Peter pe...@pblackman.plus.com wrote:
 Well, thats good news then. I couldn't find any mention of QT5 in the wiki.

The QT5 binding libs can be found in section V2.6Alpha (Qt 5.1.X) at page
 http://users.telenet.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html

In fact I recently asked in lazarus-qt list about how to test it.
I guess Zeljko and Den are on holidays and will answer later.

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


Re: [fpc-pascal] which GUI (noob)

2015-08-04 Thread Juha Manninen
On Tue, Aug 4, 2015 at 6:11 PM, Peter pe...@pblackman.plus.com wrote:
 On 03/08/15 15:41, Gour wrote:
 I would advise anyway against using LCL (Qt) on Linux at the moment.
 I understand its based on Qt4, and Qt4 is being dropped in favour of
 Qt5. At the very least, check how long your distribution will be
 supporting Qt4.

 http://perezmeyer.blogspot.co.uk/2014/11/early-announce-qt4-removal-in-jessie1.html

Qt4 may be deprecated but it will not be removed any time soon.
Was the announcement made at 1. of April? No it wasn't.
Anyway the major distros will support QT4 for a long time. Right now I
am using OpenSuse Tumbleweed rolling distro with KDE Plasma 5 desktop.
KDE is the biggest project using QT. They still need QT4 for many
applications in Plasma 5.
After many years when QT4 is removed, Lazarus LCL will already support
QT5 bindings. Alpha version of the bindings already exist.
The maintainer of LCL-QT, Zeljko, uses it for his own business. I am
pretty sure this is a safe path for anybody.
The sentence I would advise anyway against using LCL (Qt) on Linux at
the moment is plain FUD and nonsense.


 I don't think you will get a complete GTK3 in the LCL either at the
 moment. Its 'alpha' status according to the wiki.

LCL-GTK3 is alpha, yes. It needs contributors. Anybody?


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


[fpc-pascal] Reading resources

2015-07-19 Thread Juha Manninen
Lazarus examples folder has an application ResExplorer made by Alexey Lagunov.
It does not work well, images and other resource contents are not
shown. Only the resource name shows correctly.
It uses FPC resource classes. How to use them properly? I am testing
now with FPC trunk but 2.6.4 works the same way.

Simplified code when a Windows executable is read :

  Reader:=TWinPEImageResourceReader.Create;
  Res:=TResources.Create;
  Res.LoadFromFile(AFileName, Reader);

The items (TAbstractResource) of Res are stored in a TreeView and
later shown when nodes are clicked :

var
  ResItem: TAbstractResource;
...
if ResItem is TVersionResource then
  LoadVersionResource(ResItem as TVersionResource)
else
if ResItem is TBitmapResource then
  LoadBitmapResource(ResItem as TBitmapResource)
else
if ResItem is TGroupIconResource then
  LoadGroupIconResource(ResItem as TGroupIconResource)


The problem is that TBitmapResource never happens, although most of
the resources contain images.
ResItem is TGenericResource then.

LoadGroupIconResource does happen but viewing it is not implemented.
TVersionResource is the only one that really shows.

I have an idea to make a proper resource manager application
supporting reading, writing and modifying both FPC *.res and the old
Lazarus *.lrs resources. This ResExplorer would be a good starting
point if only it worked.
Is there such code already somewhere? I don't want to do duplicate work.

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


Re: [fpc-pascal] FPC roadmap?

2015-06-11 Thread Juha Manninen
On Mon, Jun 1, 2015 at 12:17 AM, Jonas Maebe jonas.ma...@elis.ugent.be wrote:
 I don't think much will still change to that branch before the release.

Then please release ASAP.

I have one sincere question: Will FPC 3.0 happen this year?
Typically from RC1 it takes ~3-4 months to the release. Now we don't
have even RC1 in sight.
Say you build RC1 after 2 months, that's August.
3-4 months from that will be November or December, still (barely) in this year.

Sorry I am joining the group asking about schedule but the situation
is getting annoying.
More and more often a development version of FPC must be recommended
for people because of Unicode, generics and many other improvements.
It does not feel right. Fortunately fpcup is now maintained again but
it cannot replace an FPC release obviously.

Are there open issues blocking the release? Do you need help with them?

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


Re: [fpc-pascal] FPC roadmap?

2015-06-11 Thread Juha Manninen
On Thu, Jun 11, 2015 at 5:33 PM, Michael Van Canneyt
mich...@freepascal.org wrote:
 After that (as in: as of monday) as far as I am concerned, RC1 may be built.

That would be sooner than I expected. Cool! Thanks in advance.

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


Re: [fpc-pascal] Release of Lazarus 1.4

2015-04-22 Thread Juha Manninen
On Wed, Apr 22, 2015 at 2:41 PM, Rainer Stratmann
rainerstratm...@t-online.de wrote:
 Are there screenshots?

Screenshots of some new features :
  http://wiki.freepascal.org/New_IDE_features_since#v1.4_.282015-04-22.29

 Is it with the new layout, one Window only?

Anchordocking is not really new but it still does not work well
enough to be installed by default.

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


Re: [fpc-pascal] fpcup fails on Linux

2015-04-18 Thread Juha Manninen
Thanks for everybody for testing.
I could finally install FPC trunk in my development machine, Mint
Linux 64-bit, using fpcup. I remember it failed also there earlier for
some reason.
I still don't know what caused the errors in the fresh XUbuntu and
other Linux distros in virtual machines. I hope fpcup will be
maintained again soon, it is a nice tool when it works.

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


[fpc-pascal] fpcup fails on Linux

2015-04-17 Thread Juha Manninen
I tried installing FPC using fpcup on some Linux systems, now on XUbuntu.
Both fixes and trunk give an error with fpjson. On Windows I can
install both without problems. Do I need another package from Ubuntu
repos?

Here fixes is set to branch fixes_3_0 :

./fpcup_linux_x86 --fpcURL=fixes
--only=FPCcleanonly,FPCgetonly,FPCbuildonly --verbose

...
The installer encountered the following error:
External command /home/juha/development/fpc/compiler/ppc386 -Tlinux
-FEbin/i386-linux -FUunits/i386-linux/
-Fu/home/juha/development/fpc/rtl/units/i386-linux/
-Fu/home/juha/development/fpc/units/i386-linux/fcl-base
-Fu/home/juha/development/fpc/units/i386-linux/paszlib
-Fu/home/juha/development/fpc/units/i386-linux/hash
-Fu/home/juha/development/fpc/units/i386-linux/rtl-extra -Ur -Xs -O2
-n -Fu/home/juha/development/fpc/rtl/units/i386-linux
-Fu/home/juha/development/fpc/packages/paszlib/units/i386-linux
-Fu/home/juha/development/fpc/packages/fcl-process/units/i386-linux
-Fu/home/juha/development/fpc/packages/hash/units/i386-linux
-Fu/home/juha/development/fpc/packages/libtar/units/i386-linux
-Fu/home/juha/development/fpc/packages/fpmkunit/units/i386-linux
-Fu/home/juha/development/fpc/packages/fcl-json/units/i386-linux
-di386 -dRELEASE -viq rstconv.pp failed with exit code 256. Console
output:
Target OS: Linux for i386
Compiling rstconv.pp
Fatal: Can't find unit variants used by fpjson
Fatal: Compilation aborted
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpcup fails on Linux

2015-04-17 Thread Juha Manninen
On Fri, Apr 17, 2015 at 3:27 PM, Michael Van Canneyt
mich...@freepascal.org wrote:
 I did a small fix, added a dependency on rtl-objpas, where the variants unit
 is located.
 Rev 30618.

 Can you please test if this fixes the issue for you ?

Using trunk now in the command.
It looks different but still fails.
I really wonder what makes the difference because fpcup takes pretty
much the same steps that a person would do.

...
Start compiling package utils-fpdoc for target i386-linux.
   Compiling fpdoc/BuildUnit_utils_fpdoc.pp
   Compiling fpdoc/dglobals.pp
The installer encountered the following error:
External command /home/juha/development/fpc/compiler/ppc386 -Tlinux
-FUfpdoc/units/i386-linux/
-Fu/home/juha/development/fpc/rtl/units/i386-linux/
-Fu/home/juha/development/fpc/units/i386-linux/fcl-base
-Fu/home/juha/development/fpc/units/i386-linux/fcl-xml
-Fu/home/juha/development/fpc/units/i386-linux/fcl-passrc
-Fu/home/juha/development/fpc/units/i386-linux/fcl-process
-Fu/home/juha/development/fpc/units/i386-linux/chm -Ur -Xs -O2 -n
-Fu/home/juha/development/fpc/rtl/units/i386-linux
-Fu/home/juha/development/fpc/packages/paszlib/units/i386-linux
-Fu/home/juha/development/fpc/packages/fcl-process/units/i386-linux
-Fu/home/juha/development/fpc/packages/hash/units/i386-linux
-Fu/home/juha/development/fpc/packages/libtar/units/i386-linux
-Fu/home/juha/development/fpc/packages/fpmkunit/units/i386-linux
-Fu/home/juha/development/fpc/packages/fcl-json/units/i386-linux
-di386 -dRELEASE -S2h -viq fpdoc/BuildUnit_utils_fpdoc.pp failed with
exit code 256. Console output:
Target OS: Linux for i386
Compiling fpdoc/BuildUnit_utils_fpdoc.pp
Compiling fpdoc/dglobals.pp
dglobals.pp(26,38) Fatal: Can't find unit StrUtils used by dGlobals
Fatal: Compilation aborted
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpcup fails on Linux

2015-04-17 Thread Juha Manninen
I found a similar error from last December, experienced by Waldo Kitty :
  https://www.mail-archive.com/fpc-devel@lists.freepascal.org/msg32256.html
but there was no solution.

Why it happens only with rstconv.pp? Many units were already compiled
before that.
My test system is a fresh XUbuntu, 32-bit. No FPC was installed before
using fpcup.

Can everybody else build FPC on Linux?

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


Re: [fpc-pascal] Using Cairo lib on Linux without X

2015-04-09 Thread Juha Manninen
FYI, I got ssh access to a Linux server and tested a program made with
Lazarus CairoCancas with NoGui widgetset.
The machine had Mint Linux and libcairo was installed. X11 was
installed, too, but not running. ldd shows libcairo depends on X11.

The program amazingly works! It builds a PDF file with Unicode text in
different languages.
The program can be found in lazarus/components/cairocanvas/examples in
case somebody wants to try it.

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


Re: [fpc-pascal] Using Cairo lib on Linux without X

2015-04-09 Thread Juha Manninen
On Thu, Apr 9, 2015 at 1:26 AM, fredvs fi...@hotmail.com wrote:
 Hum, from previous mail ;) =

 You may download src from =
 = http://cairographics.org/releases/cairo-1.14.2.tar.xz
 = unzip it.
 = $ cd cairo-1.14.2
 = $ ./configure --disable-libX11 (or --disable-X11 ?) (or --enable-X11=no
 ?)
 = $ make
 = $ sudo make install

Right, sorry, I thought the sources should come from apt-get.
I tested the configuration with the flags you suggested and also
--disable-Xlib but they don't help. There is always :
  Xlib:  yes
  Xlib Xrender:  yes
I think it must be configured in a machine without X.

FreeBSD or Gentoo would be valid choices except that my final target
machine has an Ubuntu server.

I will continue with my experiments. This is not exactly related to
FPC or Pascal any more.

Thanks for help.

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


Re: [fpc-pascal] Using Cairo lib on Linux without X

2015-04-08 Thread Juha Manninen
Thanks for answers everybody.

On Tue, Apr 7, 2015 at 11:17 PM, Graeme Geldenhuys
mailingli...@geldenhuys.co.uk wrote:
 Alternative for PDF generation, as I mentioned before to you I believe,
 fpGUI includes a very good PDF report engine which could easily work
 without depending on fpGUI or any GUI.

Don't worry Graeme, I did not forget that PDF engine. It only has so
different API that I could not yet join it into our code which
currently uses PowerPDF. The standard Canvas API fits there more
easily.

 Michael van Canneyt also created a PDF report engine (based on some of
 the code included in fpGUI), and I believe this is already in FPC Trunk
 (Michael?).

I checked carefully the recent FPC trunk history using your Git mirror and Gitk.
I don't see any PDF engine there.
In any case I will continue to adapt the PDF engine either from FpGUI
or from FPC once it is committed by Michael.
An ideal situation would be proof of concept versions using both Cairo
lib and this pure-Pascal engine.

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


Re: [fpc-pascal] Using Cairo lib on Linux without X

2015-04-08 Thread Juha Manninen
On Wed, Apr 8, 2015 at 1:21 AM, fredvs fi...@hotmail.com wrote:
 If you build the library from source, you can select
 various output streams during the configure script.

 =

 $ sudo apt-get build-dep cairo

Interesting. That works in Ubuntu but not in Mint. They are more and
more distinct.

 $ cd cairo

I guess I must download the Cairo sources from somewhere before doing
cd cairo.


 $ ./configure --disable-libX11
 $ make
 $ sudo make install


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


Re: [fpc-pascal] Using Cairo lib on Linux without X

2015-04-08 Thread Juha Manninen
On Wed, Apr 8, 2015 at 4:36 PM, fredvs fi...@hotmail.com wrote:
 Yep, usually i use sudo apt-get build-dep xxx but it does not work any
 more...

I also have XUbuntu where I could run that command.
It downloaded and installed many packages but I don't find the cairo
source directory.
Where is it?

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


[fpc-pascal] Using Cairo lib on Linux without X

2015-04-07 Thread Juha Manninen
FPC has the API wrapper for Cairo lib. I am studying its dependencies
and maybe use it in a Linux server with no X Window installed, for
generating PDFs.

Cairo is advertized to support multiple output devices, including X
Window, image buffers, PostScript, PDF, and SVG file output.
I understand it means that X Window is required only for the X Window backend.
PDF or SVG backends should not require X Window.

However on my Linux Mint 17 libcairo has a dependency for libX11.so.6.
See :

# ldd /usr/lib/i386-linux-gnu/libcairo.so.2
linux-gate.so.1 =  (0xf77a7000)
libpthread.so.0 = /lib/i386-linux-gnu/libpthread.so.0 (0xf763b000)
libpixman-1.so.0 = /usr/lib/i386-linux-gnu/libpixman-1.so.0
(0xf7591000)
libfontconfig.so.1 =
/usr/lib/i386-linux-gnu/libfontconfig.so.1 (0xf7555000)
libfreetype.so.6 = /usr/lib/i386-linux-gnu/libfreetype.so.6
(0xf74b5000)
libpng12.so.0 = /lib/i386-linux-gnu/libpng12.so.0 (0xf748d000)
libxcb-shm.so.0 = /usr/lib/i386-linux-gnu/libxcb-shm.so.0 (0xf7489000)
libxcb-render.so.0 =
/usr/lib/i386-linux-gnu/libxcb-render.so.0 (0xf747f000)
libxcb.so.1 = /usr/lib/i386-linux-gnu/libxcb.so.1 (0xf745c000)
libXrender.so.1 = /usr/lib/i386-linux-gnu/libXrender.so.1 (0xf7451000)
libX11.so.6 = /usr/lib/i386-linux-gnu/libX11.so.6 (0xf731d000)
libXext.so.6 = /usr/lib/i386-linux-gnu/libXext.so.6 (0xf730a000)
libz.so.1 = /lib/i386-linux-gnu/libz.so.1 (0xf72f)
librt.so.1 = /lib/i386-linux-gnu/librt.so.1 (0xf72e6000)
libm.so.6 = /lib/i386-linux-gnu/libm.so.6 (0xf72a)
libc.so.6 = /lib/i386-linux-gnu/libc.so.6 (0xf70f2000)
/lib/ld-linux.so.2 (0xf77a8000)
libexpat.so.1 = /lib/i386-linux-gnu/libexpat.so.1 (0xf70c9000)
libXau.so.6 = /usr/lib/i386-linux-gnu/libXau.so.6 (0xf70c5000)
libXdmcp.so.6 = /usr/lib/i386-linux-gnu/libXdmcp.so.6 (0xf70bd000)
libdl.so.2 = /lib/i386-linux-gnu/libdl.so.2 (0xf70b8000)

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


[fpc-pascal] Binary code generated for Integer and PtrInt

2015-01-02 Thread Juha Manninen
Does it make sense to use PtrInt instead of Integer for optimization or
code size reasons?
In other words, does the compiler generate faster or smaller code in 64-bit
CPUs for the native integer size?
Does it depend on architecture?

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

[fpc-pascal] fpcup: FPC trunk 64-bit for Windows

2014-09-30 Thread Juha Manninen
I downloaded fpcup64.exe from
  https://bitbucket.org/reiniero/fpcup/downloads

After installation everything works well, but the FPC version is 2.6.5.
How to update it to FPC trunk? I need it for testing purposes.

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


Re: [fpc-pascal] fpcup: FPC trunk 64-bit for Windows

2014-09-30 Thread Juha Manninen
On Tue, Sep 30, 2014 at 4:01 PM, Reinier Olislagers
reinierolislag...@gmail.com wrote:
 Run with fpgui and select the profile you want to run (a full build
 seems best for the initial run)

I did a new build with
  fpcup64.exe --fpcURL=trunk
and it works very well.
This is quite a big tool already. Lots of options and features. Cool!

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


[fpc-pascal] Fast CRC functions?

2014-08-25 Thread Juha Manninen
We have an old function for calculating CRC like:

function CalcCRC(const Str: String): Cardinal;
var
  Len, i, CRCVal: Cardinal;
Begin
  Len := Length(Str);
  CRCVal := $;
  if Len  0 then
for i := 1 to Len do
  CRCVal := CRCTbl[Byte(CRCVal xor Cardinal(Str[i]))] xor ((CRCVal
shr 8) and $00FF);
  Result := not(CRCVal);
end;

CRCTbl is a table with hex numbers.

Then I tested a new super-fast function crc32c() from Synopse mORMot
lib that uses Intel SSE instructions:

  
http://blog.synopse.info/post/2014/05/25/New-crc32c%28%29-function-using-optimized-asm-and-SSE-4.2-instruction

Wow, with long input data strings it is 10 * faster!
But, bummer, it returns a different value. :(
Our CRCs are stored around in DBs and we need the same value.

I thought CRC algorith is a standard but apparently not.
It says at the Synopse blog-page:
---
In fact, most popular file formats and protocols (Ethernet, MPEG-2,
ZIP, RAR, 7-Zip, GZip, and PNG) use the polynomial $04C11DB7, while
Intel's hardware implementation is based on another polynomial,
$1EDC6F41 (used in iSCSI and Btrfs).
So you would not use this new crc32c() function to replace the zlib's
crc32() function, but as a convenient very fast hashing function at
application level.
For instance, our TDynArray wrapper will use it for fast items hashing.
---

I don't know what the polynomial does here. Does it mean Intel CPUs
have built-in support for specific CRC calculations?

Does anybody know of other optimized CRC functions?
We would love the speedup.

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


Re: [fpc-pascal] Fast CRC functions?

2014-08-25 Thread Juha Manninen
Ok, thanks. This is yet another topic I should learn about.

Tony, I don't believe pycrc can generate much faster functions than
ours unless it uses SIMD.
Our function works well but it is called so ofter that its speed is relevant.

Mark, I promise to study the algorithms but changing our algorith is
not an option now. We want the same but faster.
Maybe loop unrolling can make it little faster but nothing compared to
a SIMD version of course.

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


[fpc-pascal] Setting execute bit for a Unix file

2014-07-31 Thread Juha Manninen
Hello

How can I set a file flag (execute) using Pascal code in a Linux system?

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


Re: [fpc-pascal] Setting execute bit for a Unix file

2014-07-31 Thread Juha Manninen
On Thu, Jul 31, 2014 at 11:26 PM, Karoly Balogh (Charlie/SGR)
char...@scenergy.dfmk.hu wrote:
 Naaah, better use FpChmod() in BaseUnix unit:
 http://www.freepascal.org/docs-html/rtl/baseunix/fpchmod.html

Right, I was looking at page
  http://www.freepascal.org/docs-html/rtl/unix/index-5.html
but did not notice this one.
Thanks Karoly and David.

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


[fpc-pascal] FPC 2.7.1 snapshot for Win32

2014-07-29 Thread Juha Manninen
How to test the compiled FPC snapshot binaries on Windows?
I found a link from this page:
  http://www.freepascal.org/develop.var
under header
  Download Daily Update of Development Tree (trunk)
I think it should be
  Download Daily Compiled Binaries of Development Tree (trunk)
but it is no big deal. (I would fix it in the wiki but I cannot).

I downloaded a binary package for Win32, unpacked it, adjusted Windows
PATH for the new directory and copied fpc.cfg from older 2.6.4
version.
I did not see anything version dependent in the fpc.cfg so I did not change it.
I have the latest FPC sources from Graeme's git mirror.

fpc starts and a simple  WriteLn('hello');  compiles, but non-trivial
code gives errors because of library units not found.
XML example does not find DOM, Lazarus does not find ServiceManager etc.

I have installed FPC trunk on Linux but I have no recollection of this one.
Should I add path to sources somewhere?
Where can I find short and clear instructions of how to use the binary
snapshots?
For some reason the /develop.var page does not have any.

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


Re: [fpc-pascal] FPC 2.7.1 snapshot for Win32

2014-07-29 Thread Juha Manninen
On Tue, Jul 29, 2014 at 6:07 PM, Sven Barth
 Did you check that the paths inside the fpc.cfg are really the correct ones?

Right. After all I missed the important parts of fpc.cfg.
I had copied it from FPC under Lazarus installation dir.
There the paths are C:\lazarus\fpc\$FPCVERSION.
I don't know where $FPCVERSION is defined but I hardcoded the path as
C:\FPC\2.7.1 and it works.
Thanks.

I also had to copy GNU utils. I found instructions in forum:
 http://forum.lazarus.freepascal.org/index.php?topic=22248.0
I don't know are there instructions for that elsewhere.

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


[fpc-pascal] cthreads

2014-07-25 Thread Juha Manninen
I was asked why a threaded application compiles on Linux without uses
cthreads but it does not work.
cthreads must _always_ be added to uses section.
I had no answer to that. IMO such errors should be trapped at
compile-time, not at run-time.
Could it be fixed somehow?
Many people experience the same run-time error about too many
concurrent threads. They must search the net and ask questions while
(I guess) the problem could be solved by forcing a compilation error.

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


Re: [fpc-pascal] Illeagal assignment to For Loop variable in Free pascal

2014-06-18 Thread Juha Manninen
On Wed, Jun 18, 2014 at 6:42 AM, Ralf Quint redro...@gmail.com wrote:
 A totally different solution and also more universal (not depending on the
 length of the filename to be exactly 8 characters long would be

while ((Length (Filename)  0) AND (Filename (Length (Filename) = ' ') do
Delete (Filename, Length (Filename), 1);

How about :
  Filename := Trim(Filename);

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


Re: [fpc-pascal] Illeagal assignment to For Loop variable in Free pascal

2014-06-18 Thread Juha Manninen
On Wed, Jun 18, 2014 at 2:36 PM, Bart bartjun...@gmail.com wrote:
 The original code removes trailing spaces only, and Trim() removes
 more than spaces (and it removes leading blanks as well).

  Filename := TrimRight(Filename);

:)

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


Re: [fpc-pascal] Canvas.TextStyle

2014-05-25 Thread Juha Manninen
Thanks. I will experiment with it.

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

[fpc-pascal] Canvas.TextStyle

2014-05-24 Thread Juha Manninen
Why can't I set members of TextStyle in TCanvas?
For example :
  Canvas.TextStyle.RightToLeft := True;
or
  Canvas.TextStyle.Layout := tlTop;

give :
 Error: Argument can't be assigned to

Canvas.TextStyle is a replacement for Delphi's Canvas.TextFlags, isn't it?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Canvas.TextStyle

2014-05-24 Thread Juha Manninen
On Sat, May 24, 2014 at 2:26 PM, Sven Barth pascaldra...@googlemail.com wrote:
 http://wiki.freepascal.org/User_Changes_2.4.0#Treating_direct-mapped_properties_as_regular_fields

Ok, then this becomes an LCL issue. How to port Delphi code like
  Canvas.TextFlags := Canvas.TextFlags or ETO_RTLREADING
  Canvas.TextFlags := Canvas.TextFlags or LAYOUT_SUPERSCRIPT;

TextStyle was the closest thing to TextFlags I could find.
If nobody knows the answer, I will continue my experiments. I know
this is not a Lazarus list.

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


Re: [fpc-pascal] [Lazarus] Lazarus 1.2.2 Release

2014-04-24 Thread Juha Manninen
On Thursday, April 24, 2014, Reinier Olislagers reinierolislag...@gmail.com
wrote:

 Yes. I'd therefore suggest that if people really want to have a 64 bit
 IDE, they should compile it themselves... (in other words, leave the
 current situation as is as it is much less likely to cause problems for
 newbies)


My feelings, too, except that people don't even need to compile themselves.
They can still go to SourceForge page and download from there.
BTW, that was the only way to download just a while ago. Only recently we
got the nice download button on the new webpage. It should provide as fail
safe choice as possible.

I plan to use the button tomorrow when updating Lazarus to my work machine.
It gives me nice feeling when things work smoothly. Now updating Lazarus is
very smooth thanks to the button and the high quality installer.

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

[fpc-pascal] minigzip example does not compile (?)

2014-04-01 Thread Juha Manninen
I also have a gzip related issue.
I try to test with paszlib/examples/minigzip but the compiler gives :

minigzip.pas(73,40) Error: Call by var for arg no. 2 has to match
exactly: Got LongInt expected SmallInt

FPC 2.6.4 and FPC trunk seem to have identical code here.

It is possible I do something stupid. Should I add compiler flags?

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


Re: [fpc-pascal] minigzip example does not compile (?)

2014-04-01 Thread Juha Manninen
Another note about paszlib sources. There is a spelling mistake in the
header comment which is copied to every source file:
 Pascal tranlastion

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


Re: [fpc-pascal] minigzip example does not compile (?)

2014-04-01 Thread Juha Manninen
On Tue, Apr 1, 2014 at 11:09 AM, Juha Manninen
juha.mannine...@gmail.com wrote:
 Got LongInt expected SmallInt

I opened the example program in Lazarus for debugging it.
Lazarus project uses mode objfpc by default. Changing 2 variables from
Integer to SmalInt solved the compilation problem.
IMO the type should be corrected as debugging with Lazarus is often a good idea.

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


Re: [fpc-pascal] minigzip example does not compile (?)

2014-04-01 Thread Juha Manninen
BTW, does anybody know of a Delphi compatible version of this compression lib?
The new Unicode Delphis do not need to be supported.
What about some other similar Delphi compatible lib?

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


Re: [fpc-pascal] minigzip example does not compile (?)

2014-04-01 Thread Juha Manninen
On Tue, Apr 1, 2014 at 1:53 PM, Marco van de Voort mar...@stack.nl wrote:
 Newer delphi's come with a zstream iirc, and contrary to D7(*), you don't need
 to do anything. (unit zlib, tzcompressionstream and -de variant + helper
 procedures). I use them for the png compression in my ported fcl-image parts.

Yes but we still have Delphi 2007.
It only has TCompressionStream but no TZCompressionStream.
Maybe we could just add our own metadata wrapper instead of gzip or a
zlib wrapper.
Well, it does not sound like a clever thing to do.

We have used tpabbrevia but it has a bug with very big files (like 6
GB). Its code is not easy to understand and I would rather not start
searching the bug.

Marco, what was the FPC counterpart for TZCompressionStream in your
Delphi-compatible code? FPC does not have TZCompressionStream either.

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


[fpc-pascal] THandle in code that must compile also with Delphi

2014-03-20 Thread Juha Manninen
FileCreate and FileOpen return THandle with FPC but integer with Delphi2007.
Delphi defines THandle as LongWord but for some reason Integer is used instead.
With FPC on a 64-bit system THandle is 64- bit unsigned.

Question: what is the best way to maintain code that must compile with
both FPC and Delphi2007?
The obvious solution is to use IFDEF and define a new type, say TMyHandle.
FPC's libraries however take care of many platform differences. Is
there any better way to solve this?

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


Re: [fpc-pascal] THandle in code that must compile also with Delphi

2014-03-20 Thread Juha Manninen
On Thu, Mar 20, 2014 at 3:25 PM, Virgo Pärna virgo.pa...@mail.ee wrote:
 I did try googling and it appears, that in 64 bit Delphi XE2 uses THandle
 as a result type. Anyway, in the case of error, it returns 
 INVALID_HANDLE_VALUE,
 which is DWORD(-1).
So, under Windows it would be possible to use same code, if you compare 
 result
 against INVALID_HANDLE_VALUE. And you should be able safely cast return value 
 to
 THandle for that (and use variable of that type).
I really don't know, how it would work on linux, because sys_open seems to 
 return
 int there.

Thanks Virgo for this note. I was just thinking of how to check for errors.
In many places our Delphi code has :
  if Handle-1 then begin
...
  end;

I will not define a new type after all, instead I will use THandle
everywhere and then compare against INVALID_HANDLE_VALUE which is
defined in Windows unit also for Delphi2007.
The only downside is that Delphi compiler will complain about
incompatible types (signed / unsigned) when assigning FileCreate()
etc. return values. I must use typecast then but it is OK.

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


Re: [fpc-pascal] How to know the string type of a variable?

2013-12-30 Thread Juha Manninen
On Mon, Dec 30, 2013 at 9:17 PM, Mattias Gaertner
nc-gaert...@netcologne.de wrote:
 if FindInvalidUTF8Character(PChar(Pointer(s)),length(s))0 then
   // UTF-8

Uhhh! I will be totally screwed when I must do a unicode conversion myself.
What was this PChar(Pointer(s)) again? PChar is a pointer, why does
it need a double cast?

BTW, IsASCII function does not help here. It only checks the lower ascii area.

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


[fpc-pascal] FastMM for FPC?

2013-11-25 Thread Juha Manninen
Hello

We found an old link from 2005 about a FastMM port :

http://free-pascal-general.1045716.n5.nabble.com/First-Test-of-FastMM4-for-fpc-td2809801.html

Is it still alive? Is there a version that works with recent FPCs?
Support for Win32 would be enough obviously.
We are comparing different memory managers under heavy load at my work.

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


Re: [fpc-pascal] Re: Cross Compile : treefilteredit.pas(60, 60) Error: Illegal expression

2013-11-24 Thread Juha Manninen
On Sun, Nov 24, 2013 at 1:00 PM, Osvaldo Filho arquivos...@gmail.com wrote:
   TBranchList = specialize TFPGObjectListTTreeFilterBranch; // line 60

The syntax is perfectly valid and compiles fine here with FPC 2.6.2.

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


[fpc-pascal] CompareMem documentation

2013-11-14 Thread Juha Manninen
Documentation here:
  http://lazarus-ccr.sourceforge.net/docs/rtl/sysutils/comparemem.html

says that the function returns 0, 0 or 0
while actually it returns a Boolean.

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


Re: [fpc-pascal] CompareMem documentation

2013-11-14 Thread Juha Manninen
On Thu, Nov 14, 2013 at 9:42 PM, Vincent Snijders
vincent.snijd...@gmail.com wrote:
 Those docs are outdated: see up to date docs at:
 http://www.freepascal.org/docs-html/rtl/sysutils/comparemem.html

Ok, thanks.

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


Re: [fpc-pascal] Powtils: lightwebserver, lightwebserver2 or lightwebserver3?

2013-11-01 Thread Juha Manninen
On Fri, Nov 1, 2013 at 6:53 PM, silvioprog silviop...@gmail.com wrote:
 Once I did a test and fphttpserver responded to 2000 requests per second. ;)

The speed depends on page contents, too, but anyway that sounds very fast.

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


Re: [fpc-pascal] Powtils: lightwebserver, lightwebserver2 or lightwebserver3?

2013-10-31 Thread Juha Manninen
On Mon, Oct 28, 2013 at 3:22 PM, Graeme Geldenhuys
gra...@geldenhuys.co.uk wrote:
 Having recently (and currently still) doing extensive work with embedded
 HTTP servers, I tested many (Powtils, Indy, tiWebServer, FPC, nYume etc). I
 must agree with Michael, fphttpserver is a good choice. There is a bit of a
 learning curve [compared to some others], but nothing major. Overall, I'm
 very happy with the final choice on fphttpserver.

Out of curiosity, how is its performance compared to Indy based web server.
My current employer has a highly optimized data system with custom web
server and custom DB. No SQL sentences and no SQL DBs obviously. The
load it can handle is quite impressive.
It manages information for schools: personnel, students, courses,
exams, timetables, messaging etc.

I understood Graeme's system is also for schools but handles the
actual learning material which makes it different.
Yet I believe it also has high performance requirements and must
handle heavy load.

My employer (StarSoft, Finland) system is compiled with both Delphi
and FPC, on Windows and Linux.
Porting the code for Unicode so it still works with both Delphi and
FPC is a challenge. Uhhh!
I will not tell more or I will reveal company secrets.

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


[fpc-pascal] fcl-process, SimpleIPC and pipes

2013-10-08 Thread Juha Manninen
I must implement communication between 2 processes.
I believe SimpleIPC is good for that purpose and it is well tested in
a cross-platform system (Lazarus - ChmHelp).

Named pipes were suggested to me. I would like to know the benefits /
handicaps of SimpleIPC compared to named pipes. I will have to answer
such questions myself soon.

fcl-process also has pipes unit and then pipesipc which apparently
does not use pipes. (?)

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


Re: [fpc-pascal] fcl-process, SimpleIPC and pipes

2013-10-08 Thread Juha Manninen
Thanks Michael and Mark for informative answers.

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


Re: [fpc-pascal] Sets

2013-10-03 Thread Juha Manninen
On Thu, Oct 3, 2013 at 1:58 AM, Jonas Maebe jonas.ma...@elis.ugent.be wrote:
 It is part of {$mode delphi}:
 http://wiki.freepascal.org/User_Changes_2.6.0#Sizes_of_sets_in_TP.2FDelphi_mode

Ok, sorry Marco and Jonas.
This unit did not have Mode Delphi. I thought the setting in a Lazarus
project was enough but no. This unit is not part of the project but is
used by it.
This is a big code base I must learn. Some units must compile with
Delphi and FPC, some units only with Delphi.
It is better to put :
 {$IFDEF FPC}
   {$MODE Delphi}
 {$ENDIF}

in every unit.

Thanks and regards,
Juha
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Sets

2013-10-02 Thread Juha Manninen
If I have have a set with  9 elements, like :

type
  TMyEnum = (
xOne,
xTwo,
xThree,
xFour,
xFive
  );
  // Count = 8, fits in one Byte
  TMyEnums = set of TMyEnum;

then in Delphi a variable of that type can be casted to Byte. Other
casts don't work.
In FPC I must cast it to Integer!
Does it really mean that all sets in FPC reserve at least 32 bits? Is
it documented? I did not find it as Set gives so many false matches.

I hope the implementation is otherwise compatible with Delphi, meaning
that the bits start from LSB always. I rely now on this implementation
detail. There is code that transfers bitfields between computers.
Using type checking and descriptive names makes the code better in
many ways, compared to using integers  AND operator.

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


Re: [fpc-pascal] Sets

2013-10-02 Thread Juha Manninen
On Wed, Oct 2, 2013 at 10:50 PM, Sven Barth pascaldra...@googlemail.com wrote:
 And as Peter already mentioned there is $PACKSET:
 http://freepascal.org/docs-html/prog/progsu61.html#x67-660001.1.61

Ok, {$PACKSET 1} helps.
I expected it to be part of {$Mode Delphi}. Most things are Delphi
compatible with it.
Thanks.

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


[fpc-pascal] Nested comments

2013-09-23 Thread Juha Manninen
I realized FPC supports nested {} comments by default.
SynPdf, a Synopse PDF engine
  http://synopse.info/fossil/wiki?name=PDF+Engine
has '{' characters inside comments but they are not meant as nested comments.

How to turn nested comments off?
I did not find any such option even by using the new advanced (!) All
Options GUI in Lazarus.

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


Re: [fpc-pascal] Nested comments

2013-09-23 Thread Juha Manninen
On Mon, Sep 23, 2013 at 3:06 PM, Michael Van Canneyt
mich...@freepascal.org wrote:
 Use Delphi mode or TP mode.

Thanks, it helped.
Actually there already was {$MODE Delphi} in an include file.
Apparently it does not work, it must be in every pascal unit.

This PDF package still does not compile with Lazarus. I will see which
is easier, port it for Lazarus or add embedded font support for
PowerPDF.
If somebody knows a solution for PDF embedded fonts, please tell me.

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


Re: [fpc-pascal] Compilation Error At revision 25270.

2013-08-17 Thread Juha Manninen
On Sat, Aug 17, 2013 at 3:40 AM, waldo kitty wkitt...@windstream.net wrote:
 FWIW: i learned a while back (from the lazarus list i think) to perform
 make clean before svn up because the make files may have changed and the
 new ones may not know where the old files resided...

 performing make clean first clears the existing directories... then svn
 up followed (possibly with another make clean and then) by your normal
 build flow should result in a truly clean build flow without the possibility
 of lingering old .o and/or .a build files...

I don't think the extra make clean before svn up will really help
because the generated object files are not under revision control. To
make sure you don't have local modifications in revisioned files, do :
svn revert -R .

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


Re: [fpc-pascal] Compilation Error At revision 25270.

2013-08-17 Thread Juha Manninen
On Sat, Aug 17, 2013 at 1:25 PM, Jonas Maebe jonas.ma...@elis.ugent.be wrote:
 make clean is not about the source files. Waldo is right: you should always 
 make clean (or even better: make distclean) before updating from svn, 
 because files may move around and then make clean will only clean their 
 object and ppu files in the new locations.

Ok, I did not think of that.
I remember manually deleting all .ppu and .o files when there were
problems. make distclean would have helped then.

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


Re: [fpc-pascal] Re: [Lazarus] Should TObject or TComponent have a Comment property?

2013-07-19 Thread Juha Manninen
On Thu, Jul 18, 2013 at 10:41 PM, Kenneth Cochran
kenneth.coch...@gmail.com wrote:
 Now I'm trying to track down how the source editor invokes FPDoc support
 when you hover over an identifier. A search for FPDoc in the source turned
 up the CodeHelp unit. Anyone know if I'm on the right track?

Yes.
See also :
  TMainIDE.OIChangedTimerTimer
in unit ide/main. It updates the Object Inspector info box.

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


Re: [fpc-pascal] Re: [Lazarus] Should TObject or TComponent have a Comment property?

2013-07-18 Thread Juha Manninen
On Thu, Jul 18, 2013 at 6:26 PM, Kenneth Cochran
kenneth.coch...@gmail.com wrote:
 Anyone have
 a ballpark guess as to how much effort would it take to extend the tooltip
 for the component pallet to display the short tag from the FPDoc info?

The hint is set in unit ide/ComponentPalette, line 744 in Lazarus trunk.
I don't have details for getting the FPDoc info but you can study the
code yourself. It is used for example in the Object Inspector's
Information Box below the properties.
I don't think the feature requires much code once you have figured out
where to get the needed data. This is typical in a big project. A
commit with only few lines of code has required many hours of studying
the existing code.

May the source be with you! :)

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


  1   2   3   >