[fpc-pascal] free pascal compiler on Linux Red Hat for target motorola 68k

2023-10-14 Thread LECUYER Philippe via fpc-pascal
Hi,
I search a free pascal cross compiler (for host Linux Red hat 7.x and target 
Motorola 68k)
I test the last 3.2.2 version but I doesn't find the option for target Motorola 
68k (fpc -help)
It's run when I compile an example (in examples directory) and execute on Linux 
RH 7.x but I want to produce the binary for 68k target.
Thanks for helping me.
Regards

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


Re: [fpc-pascal] Bitcounting

2016-03-05 Thread Philippe Lévi
sorry ... need change intToStr in my suggestion by something like intToStrBin
length( strChange( intToStrBin( N, '0', ''));

but it is just for fun! 


De: fpc-pascal-boun...@lists.freepascal.org 
 em nome de Bart 
Enviado: sábado, 5 de março de 2016 15:03
Para: FPC-Pascal users discussions
Assunto: [fpc-pascal] Bitcounting

Hi,

Does FreePascal have a routine for counting bits?
So that e.g. BitCount(%100110011) gives 5 (number of bits that are 1)?

I came up with (extracted from IntToBin()):

function BitCount(N: Int64): Integer;
var
  Q: QWord;
  i: Integer;
begin
  Result := 0;
  Q := QWord(N);
  for i := 0 to (8 * SizeOf(N) - 1) do
  begin
if ((Q and 1) = 1) then Inc(Result);
Q := Q shr 1;
  end;
end;

Surely this can be done better?

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


Re: [fpc-pascal] Bitcounting

2016-03-05 Thread Philippe Lévi
pseudocode
length( strChange( intToStr( N), '0', ''));


De: fpc-pascal-boun...@lists.freepascal.org 
 em nome de Bart 
Enviado: sábado, 5 de março de 2016 15:03
Para: FPC-Pascal users discussions
Assunto: [fpc-pascal] Bitcounting

Hi,

Does FreePascal have a routine for counting bits?
So that e.g. BitCount(%100110011) gives 5 (number of bits that are 1)?

I came up with (extracted from IntToBin()):

function BitCount(N: Int64): Integer;
var
  Q: QWord;
  i: Integer;
begin
  Result := 0;
  Q := QWord(N);
  for i := 0 to (8 * SizeOf(N) - 1) do
  begin
if ((Q and 1) = 1) then Inc(Result);
Q := Q shr 1;
  end;
end;

Surely this can be done better?

Bart
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
___
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 Philippe Lévi
nice! it worked fine!

thanks
Philippe


De: fpc-pascal-boun...@lists.freepascal.org 
 em nome de Juha Manninen 

Enviado: sábado, 20 de fevereiro de 2016 21:38
Para: FPC-Pascal users discussions
Assunto: Re: [fpc-pascal] Lazarus Release 1.6

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
___
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 Philippe Lévi
I still do not understand the reason why the size is 10 times bigger after 
rebuilding Lazarus ...

but ... I understood why it does not run ... Avast! is the responsible for it! 
... 

I found how to exclude lazarus directory from Avast! scanning ... and now it 
looks that Lazarus is running fine ...

Thanks  and sorry for may be useless messages!

Philippe


De: fpc-pascal-boun...@lists.freepascal.org 
 em nome de Philippe Lévi 

Enviado: sábado, 20 de fevereiro de 2016 16:14
Para: FPC-Pascal users discussions
Assunto: Re: [fpc-pascal] Lazarus Release 1.6

installed 1.6 on my windows 8 64bits machine.

the exe file is 22.398 bytes

if I rebuild Lazarus ... after installing a component or after building Lazarus 
from the Tools menu ... the exe file is more then 225.000 bytes big ... and ... 
it does not run! ...

if I reboot the machine and try to run from startlazarus.exe it stops on the 
image ("Free Pascal ... Lazarus ... Project ... ... ...") ...

if I try directly lazarus.exe ... "windows explorer" does not seem to be able 
to run it ... on then tasks manager "Windows Explorer" stays at the top of the 
list (ordered by name) ... and Lazarus does not appear ...

appreciate any tip!

Philippe


De: fpc-pascal-boun...@lists.freepascal.org 
 em nome de Martin 
Enviado: sábado, 20 de fevereiro de 2016 12:23
Para: FPC-Pascal users discussions
Assunto: Re: [fpc-pascal] Lazarus Release 1.6

On 20/02/2016 13:30, Philippe Lévi wrote:
> I may have missed something 
>
> I installed lazarus from lazarus-1.6.0-fpc-3.0.0-win64.exe
>
> everything seem to have been installed well.
>
> but when I start Lazarus ... it requires "C:\lazarus64\fpc\2.7.1\source" ... 
> but 2.6.4 has been installed!
>
> what is the best (easiest) solution to clean this situation?
>
Looks like you had a previous or parallel install with a custom config.

If you need none of your config, you can delete the old config. The
windows installer has a checkbox to do this. Or you delete the folder
"primary config path" as found in menu "view" > ide internals > ide settings

Less drastic, open the Tools > Options and
- chose the fpc inside your installation
C:\lazarus\fpc\3.0.0\bin\i386-win32\fpc.exe
- same for sources$(LazarusDir)fpc\$(FPCVer)\source

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
___
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 Philippe Lévi
installed 1.6 on my windows 8 64bits machine.

the exe file is 22.398 bytes 

if I rebuild Lazarus ... after installing a component or after building Lazarus 
from the Tools menu ... the exe file is more then 225.000 bytes big ... and ... 
it does not run! ... 

if I reboot the machine and try to run from startlazarus.exe it stops on the 
image ("Free Pascal ... Lazarus ... Project ... ... ...") ... 

if I try directly lazarus.exe ... "windows explorer" does not seem to be able 
to run it ... on then tasks manager "Windows Explorer" stays at the top of the 
list (ordered by name) ... and Lazarus does not appear ...

appreciate any tip!

Philippe


De: fpc-pascal-boun...@lists.freepascal.org 
 em nome de Martin 
Enviado: sábado, 20 de fevereiro de 2016 12:23
Para: FPC-Pascal users discussions
Assunto: Re: [fpc-pascal] Lazarus Release 1.6

On 20/02/2016 13:30, Philippe Lévi wrote:
> I may have missed something 
>
> I installed lazarus from lazarus-1.6.0-fpc-3.0.0-win64.exe
>
> everything seem to have been installed well.
>
> but when I start Lazarus ... it requires "C:\lazarus64\fpc\2.7.1\source" ... 
> but 2.6.4 has been installed!
>
> what is the best (easiest) solution to clean this situation?
>
Looks like you had a previous or parallel install with a custom config.

If you need none of your config, you can delete the old config. The
windows installer has a checkbox to do this. Or you delete the folder
"primary config path" as found in menu "view" > ide internals > ide settings

Less drastic, open the Tools > Options and
- chose the fpc inside your installation
C:\lazarus\fpc\3.0.0\bin\i386-win32\fpc.exe
- same for sources$(LazarusDir)fpc\$(FPCVer)\source

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
___
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 Philippe Lévi
reinstalled with clean option ... it looks ok now!

thanks again
Philippe


De: fpc-pascal-boun...@lists.freepascal.org 
 em nome de Martin 
Enviado: sábado, 20 de fevereiro de 2016 12:23
Para: FPC-Pascal users discussions
Assunto: Re: [fpc-pascal] Lazarus Release 1.6

On 20/02/2016 13:30, Philippe Lévi wrote:
> I may have missed something 
>
> I installed lazarus from lazarus-1.6.0-fpc-3.0.0-win64.exe
>
> everything seem to have been installed well.
>
> but when I start Lazarus ... it requires "C:\lazarus64\fpc\2.7.1\source" ... 
> but 2.6.4 has been installed!
>
> what is the best (easiest) solution to clean this situation?
>
Looks like you had a previous or parallel install with a custom config.

If you need none of your config, you can delete the old config. The
windows installer has a checkbox to do this. Or you delete the folder
"primary config path" as found in menu "view" > ide internals > ide settings

Less drastic, open the Tools > Options and
- chose the fpc inside your installation
C:\lazarus\fpc\3.0.0\bin\i386-win32\fpc.exe
- same for sources$(LazarusDir)fpc\$(FPCVer)\source

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
___
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 Philippe Lévi
you probably right! I'll check soon.



De: fpc-pascal-boun...@lists.freepascal.org 
 em nome de Martin 
Enviado: sábado, 20 de fevereiro de 2016 12:23
Para: FPC-Pascal users discussions
Assunto: Re: [fpc-pascal] Lazarus Release 1.6

On 20/02/2016 13:30, Philippe Lévi wrote:
> I may have missed something 
>
> I installed lazarus from lazarus-1.6.0-fpc-3.0.0-win64.exe
>
> everything seem to have been installed well.
>
> but when I start Lazarus ... it requires "C:\lazarus64\fpc\2.7.1\source" ... 
> but 2.6.4 has been installed!
>
> what is the best (easiest) solution to clean this situation?
>
Looks like you had a previous or parallel install with a custom config.

If you need none of your config, you can delete the old config. The
windows installer has a checkbox to do this. Or you delete the folder
"primary config path" as found in menu "view" > ide internals > ide settings

Less drastic, open the Tools > Options and
- chose the fpc inside your installation
C:\lazarus\fpc\3.0.0\bin\i386-win32\fpc.exe
- same for sources$(LazarusDir)fpc\$(FPCVer)\source

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
___
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 Philippe Lévi
I may have missed something 

I installed lazarus from lazarus-1.6.0-fpc-3.0.0-win64.exe

everything seem to have been installed well.

but when I start Lazarus ... it requires "C:\lazarus64\fpc\2.7.1\source" ... 
but 2.6.4 has been installed! 

what is the best (easiest) solution to clean this situation?

thanks
Philippe


De: fpc-pascal-boun...@lists.freepascal.org 
 em nome de Mattias Gaertner 

Enviado: quinta-feira, 18 de fevereiro de 2016 12:27
Para: fpc-pascal@lists.freepascal.org
Assunto: [fpc-pascal] Lazarus Release 1.6

The Lazarus team is glad to announce the release of Lazarus 1.6.

This release was built with FPC 3.0.0.
The previous release Lazarus 1.4.4 was built with FPC 2.6.4.

Here is the list of changes for Lazarus and Free Pascal:
http://wiki.lazarus.freepascal.org/Lazarus_1.6.0_release_notes
http://wiki.lazarus.freepascal.org/User_Changes_3.0.0

The release is available for download on SourceForge:
http://sourceforge.net/projects/lazarus/files/

Choose your CPU, OS, distro and then the "Lazarus 1.6" directory.

Checksums for the SourceForge files:
http://www.lazarus-ide.org/index.php?page=checksums#1_6

Minimum requirements:

Windows:
  98, 2000, XP, Vista, 7, 8/8.1, 10, 32 or 64 bit.
  Win98 and WinNT IDE needs FPC 2.6.4 and building with flag
-dWIN9XPLATFORM.

FreeBSD/Linux:
  gtk 2.8 or qt4.5, 32 or 64bit.

Mac OS X:
  10.5 to 10.11, LCL only 32bit, non LCL apps can be 64bit.

The svn tag is
http://svn.freepascal.org/svn/lazarus/tags/lazarus_1_6

Here is the list of fixes for Lazarus 1.6:
http://wiki.freepascal.org/Lazarus_1.6_fixes_branch

For people who are blocked by SF, the Lazarus releases from SourceForge
are mirrored at:
ftp://freepascal.dfmk.hu/pub/lazarus/releases/
and later at (after some time for synchronization)
http://michael-ep3.physik.uni-halle.de/Lazarus/releases/
and
http://mirrors.iwi.me/lazarus/

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


Re: [fpc-pascal] New feature: IfThen() intrinsic

2016-02-01 Thread Philippe Lévi
I thought about "condEval( cnd, true, false);"


we are looking for a name of a function ... and "if" is a statment ... 
variations of  "if" still have the flavour of statment name ...


Philippe


De: fpc-pascal-boun...@lists.freepascal.org 
 em nome de Roberto P. 

Enviado: segunda-feira, 1 de fevereiro de 2016 19:34
Para: FPC-Pascal users discussions
Assunto: Re: [fpc-pascal] New feature: IfThen() intrinsic

Maybe we shouldn't focus all that much on the " if " word..since all in all, it 
is meant to be differently from the language if-then-else
What about using another word suggesting a choice?

   j := Switch(i < 32, 48, 21);
   j := Select(i < 32, 48, 21);
   j := Which(i < 32, 48, 21);

They look to me as a goog compromise between expressiveness (IfThen) and 
typing-laziness (iif).

Roberto


2016-02-01 20:24 GMT+01:00 Philippe Lévi 
mailto:phili...@quarta.com.br>>:
iif ... sounds good to me! +1 !
Philippe


De: 
fpc-pascal-boun...@lists.freepascal.org<mailto:fpc-pascal-boun...@lists.freepascal.org>
 
mailto:fpc-pascal-boun...@lists.freepascal.org>>
 em nome de Marco van de Voort mailto:mar...@stack.nl>>
Enviado: segunda-feira, 1 de fevereiro de 2016 16:22
Para: FPC-Pascal users discussions
Assunto: Re: [fpc-pascal] New feature: IfThen() intrinsic

In our previous episode, Maciej Izak said:
> >
> iif is not semantic clear.  IIF means "Immediate IF". Citation: "both
> truepart and the falsepart will be evaluated regardless of which one is
> actually returned." - https://en.wikipedia.org/wiki/IIf

Well, correct that then :)
___
fpc-pascal maillist  -  
fpc-pascal@lists.freepascal.org<mailto:fpc-pascal@lists.freepascal.org>
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
___
fpc-pascal maillist  -  
fpc-pascal@lists.freepascal.org<mailto:fpc-pascal@lists.freepascal.org>
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

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

Re: [fpc-pascal] New feature: IfThen() intrinsic

2016-02-01 Thread Philippe Lévi
iif ... sounds good to me! +1 !
Philippe


De: fpc-pascal-boun...@lists.freepascal.org 
 em nome de Marco van de Voort 

Enviado: segunda-feira, 1 de fevereiro de 2016 16:22
Para: FPC-Pascal users discussions
Assunto: Re: [fpc-pascal] New feature: IfThen() intrinsic

In our previous episode, Maciej Izak said:
> >
> iif is not semantic clear.  IIF means "Immediate IF". Citation: "both
> truepart and the falsepart will be evaluated regardless of which one is
> actually returned." - https://en.wikipedia.org/wiki/IIf

Well, correct that then :)
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpGUI Toolkit v1.4.1 released

2015-09-04 Thread Philippe Lévi
no problem ... 


De: fpc-pascal-boun...@lists.freepascal.org 
 em nome de Graeme Geldenhuys 

Enviado: quinta-feira, 3 de setembro de 2015 14:16
Para: fpc-pascal@lists.freepascal.org
Assunto: Re: [fpc-pascal] fpGUI Toolkit v1.4.1 released

On 2015-09-03 01:42, Philippe Lévi wrote:
>
> what about emails I sent a week ago?

I'll get back to you as soon as I can... the weekend.


> (some stuffs could have been inserted in the release ... may be!).

There is *always* extra stuff that could make it into any release. :) I
didn't want to delay the 1.4.1 maintenance release any more, because
there are some critical fixes in there.

Those changes will have to wait for the next maintenance release I'm
afraid, or if they are new features (not fixes), then into the 'develop'
branch first.


Regards,
  - Graeme -

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpGUI Toolkit v1.4.1 released

2015-09-02 Thread Philippe Lévi
nice ...

what about emails I sent a week ago? ... (some stuffs could have been inserted 
in the release ... may be!).

P.



De: fpc-pascal-boun...@lists.freepascal.org 
 em nome de Graeme Geldenhuys 

Enviado: quarta-feira, 2 de setembro de 2015 19:56
Para: FPC-Pascal users discussions
Assunto: [fpc-pascal] fpGUI Toolkit v1.4.1 released

Hi,

I'm glad to announce the v1.4.1 maintenance release of fpGUI. I'll
shortly update the file and documentation downloads on SourceForge.

Source Code:


from SourceForge:
  git clone git://git.code.sf.net/p/fpgui/code fpgui

from GitHub:
  git clone git://github.com/graemeg/fpGUI.git


The 'master' branch contains the latest released fpGUI (v1.4.1), and the
'develop' branch contains the latest development work on fpGUI.

For more details, please visit the fpGUI home page:

  http://fpgui.sourceforge.net


[ Full changelog for v1.4.1 ]-

Changes by Author:
==

Graeme Geldenhuys (44):
  WinCE: fixes compilation errors for WinCE-ARM
  wince: adds a new batch file for WinCE-ARM target
  Fix compilation error for 'canvastest' demo
  Disable -dDEBUG compiler define under windows (build from batch
 file).
  Removes the -dDEBUG compiler define for *nix environments too.
  Win: DND support is now toggled by a feature compile define, not
 platform define
  extras: Updated "new project types" package for Lazarus IDE
 integration
  Lazarus IDE add-on's: changed the way the forms are created.
  example: Fixes compiler error  - fpgApplication.DefaultFont was
 removed a while ago
  Fixes compiler error when AggCanvas is enabled.
  New resource string values for File Dialog buttons
  dialogs: We had a SetupCaptions method, but nothing ever called
 it!
  file dialog: set button hint values
  Updated language PO files.
  bug: OnKeyPress() keycode parameter was 0 for internally consumed
 keys.
  pdf: Translated French identifier names to English
  pdf: translated more French identifiers to English
  pdf: Code clean-up, removing empty destructors.
  RichText: fixed the bug where Underlined text didn't work.
  richview: fixes bug with Italic text adding an extra space at the
 end
  richview: earmarked TRichTextView.CopyTextToBuffer() to be removed
  ActiveTabColor/ActiveTabTextColor now defaults to clDefault
  PageControl: Implements standardised Ctrl+TAB and Ctrl+Shift+TAB
 shortcuts.
  docview: updated code comment to mention missing IPF tag.
  docview: Fix bug where centered text setting was kept for longer
 than needed
  SpinEdit & SpinEditFloat now has a default Height - same as
 TfpgEdit.
  fpg_spinedit: Introduced a new overloaded CreateSpinEdit()
 function.
  spinedit: minor code formatting
  Minor compilation fix - differences between stable vs develop
 branch
  Bugfix for X11: Thread synchronize stops working if no mouse input
  demo: colorwheel - minor tweaks
  fpc lang ref: minor tweak to make the large number easier to read.
  docview: reuse fpgApplication.ShowException() instead.
  Removes hard-coded English text in TfpgApplication.ShowException()
  docview todo list update
  docview: Fixes memory leak with processing files from command line
 parameters
  docview: file offset will always be a positive value.
  docview: minor code formatting
  docview: lzw decmopress tweak.
  docview: finally fixed the broken INF image support.
  docview: new project file for use with MSEide.
  dbtest: updates buttons with actual images.
  updates release process documentation.
  Bump version number for the release.

Jean-Marc Levecque (13):
  Updated French translations
  Minor fix to French rsLanguage resource string
  Allow tabs color setting
  Anchors edtHeight in case of resizing
  Make value calculation use maximum color value as divider
  Allow to type hexa value for color selection
  Color setting improvement in colorwheel
  Add selection of predefined colors using colorlistbox
  Make predefined color values converted first to hexa for
 conversion precision
  Selection of predefined colors shown on colorwheel and valuebar
  Change saturation and value to 0-100 and value name to brightness
  Allow tabtext color setting
  Anchors label "Height" in case of resizing

Philippe Lévi (2):
  richview: correctly typecast result in TLayoutLineList.GetItem()
  richview: fix bug where varied size fonts didn't start on
 baseline.

Stéphane Aulery (1):
  Clean up unused local variables



Changed Files:
==

docs/fpc_lang_ref.ipf
docs/manifest

[fpc-pascal] TBGRABitmap / bounds

2015-07-21 Thread Philippe Lévi
  bmp := TBGRABitmap.Create(1024,1024, clBlack);
  bmp.FontHeight := 30;
  bmp.FontAntialias := true;
  bmp.FontStyle := [fsBold];
  bmp.TextOut( 0, 0, textonaovazio, ColorToBGRA(ColorToRGB( clWhite)), 
taLeftJustify);

  bounds := bmp.GetImageBounds;


bounds contains 0,1024 0,1024


and I need bounds of text generated by TextOut. Is it avalaible somewhere?


thank for any hint

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

Re: [fpc-pascal] Use sleep in thread

2015-02-25 Thread Philippe Lévi
synchronising tools do not do what you want?



De: fpc-pascal-boun...@lists.freepascal.org 
 em nome de Xiangrong Fang 

Enviado: quarta-feira, 25 de fevereiro de 2015 12:33
Para: FPC-Pascal users discussions
Assunto: Re: [fpc-pascal] Use sleep in thread

2015-02-25 23:16 GMT+08:00 mailto:hinsta...@yandex.ru>>:
not sure if this helps, but:
for example, if you want thread T to run using approx. 70% of max. available 
capacity, try this:

repeat
  T.Resume;
  Sleep(70);
  T.Resume;
  Sleep(30);
until ...

?This seems not what I want. I would like to schedule it from within the 
thread.  My demo program is here:

https://github.com/xrfang/fpcollection/blob/master/src/demos/asyncdo/demo.lpr

TAsyncDo is the class I wrote to have a procedure run in parallel.

I want to control priority of the thread from within the worker, not from the 
main thread. ?

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

Re: [fpc-pascal] TThread.Queue vs TThread.Synchronize

2015-02-23 Thread Philippe Lévi
what you want to do makes sense? I don't think so. Thread code "may not" access 
stack values of calling code ...



De: fpc-pascal-boun...@lists.freepascal.org 
 em nome de silvioprog 

Enviado: segunda-feira, 23 de fevereiro de 2015 15:32
Para: FPC-Pascal users discussions
Assunto: Re: [fpc-pascal] TThread.Queue vs TThread.Synchronize

On Mon, Feb 23, 2015 at 3:23 PM, Sven Barth 
mailto:pascaldra...@googlemail.com>> wrote:
[...]=== code begin ===

procedure TMyThread.Execute;
var
  s: String;

  procedure SyncOnPrint;
  begin
fOnPrint(s);
  end;

begin
  s := 'Hello World';
  Queue(@SyncOnPrint);
end;

=== code end ===

How to compile it?:

Error: Incompatible type for arg no. 1: Got "", expected "".

--
Silvio Clécio
My public projects - github.com/silvioprog
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] TThread.Queue vs TThread.Synchronize

2015-02-23 Thread Philippe Lévi
I "thought" it was not possible to use local procedure address as parameter 
like in queue( @SyncOnPrint);
as Clecio showed ...


De: fpc-pascal-boun...@lists.freepascal.org 
 em nome de Sven Barth 

Enviado: segunda-feira, 23 de fevereiro de 2015 15:23
Para: fpc-pascal@lists.freepascal.org
Assunto: Re: [fpc-pascal] TThread.Queue vs TThread.Synchronize

On 23.02.2015 18:58, Graeme Geldenhuys wrote:
> Continuing on the TThread.Queue subject - is there any way to pass
> parameters (or record structure with basic types) to the Queue() call?
>
> That would be super useful instead of putting thread locking on
> variables (for example, reading a progress value to update a GUI
> progress bar).

Currently the only method is to use fields that belong to the TThread
instance.

> I understand that anonymous methods (something I again don't know much
> about) take a snapshot of local variables. So that could possibly be
> used with TThread.Queue() to send variable (simple data types)
> information? Please correct my if I am wrong - like I said, I don't
> really know anonymous methods or their real usage.

In Delphi both TThread.Queue() and TThread.Synchronize() have overloads
to accept anonymous functions. It would then work like this:

=== code begin ===

type
   TPrintEvent = procedure(const aMsg: String) of object;

   TMyThread = class(TThread)
   private
 fOnPrint: TPrintEvent;
   protected
 procedure Execute; override;
 property OnPrint: TPrintEvent read fOnPrint write fOnPrint;
   end;

procedure TMyThread.Execute;
var
   s: String;
begin
   s := 'Hello World';
   Queue(procedure
 begin
   fOnPrint(s);
 end);
end;

=== code end ===

In this example both "fOnPrint" and "s" would be captured by the
anonymous functions and will be available even after the thread has
terminated.

For FPC modes and those people that dislike the syntax of anonymous
functions (and yes, I can understand those people ;) ) I hope that we'll
get the following variation to work as well:

=== code begin ===

procedure TMyThread.Execute;
var
   s: String;

   procedure SyncOnPrint;
   begin
 fOnPrint(s);
   end;

begin
   s := 'Hello World';
   Queue(@SyncOnPrint);
end;

=== code end ===

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


Re: [fpc-pascal] raw printing throught USB port / WINDOWS

2015-01-13 Thread Philippe

Em 16.12.2014 10:35, LacaK escreveu:


Is the printer already known to Windows (can you print to that printer
from others windows applications) ?
If yes, then you can use:
Printer.SetPrinter('Printer name');
-Laco.


Em 16.12.2014 09:27, LacaK escreveu:


You can use:
Printer.RawMode := True;
Printer.BeginDoc;

Printer.EndDoc;
-Laco.



Thank you, but that the part I already knew (saw it searching in
Google).

The question is how to select the USB port and create Printer (
win32/win


5px; width: 100%;">

; margin-left: 5px; width: 100%;">

I need a solution (unit?) to access printer (matricial


win32 or win64.

apreciate any ideia

thanks

Philippe
-



I have been busy with other stuff ... back to this topic!

First: could anyone tell me I have the possibility to access USB 
printer in raw mode with the "basic" FPC package (not using Lazarus 
packages/components)?





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




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


[fpc-pascal] windows handle

2015-01-09 Thread Philippe
 

I create a window using GLUTCREATEWINDOW


https://www.opengl.org/documentation/specs/glut/spec3/node16.html


and need MPlayer to run a video in the window created ... 

(should be
some other list ... just tell me please!) 

how to retrieve window
handle (or other information) I should pass to Mplayer (through -wid
parameter? ... I am not sure)? 

appreciate any hint! 

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

Re: [fpc-pascal] raw printing throught USB port / WINDOWS

2014-12-16 Thread Philippe
 

good! ... I'll try that ... simple!!! 

thank you! 

Em 16.12.2014
10:35, LacaK escreveu: 

> Is the printer already known to Windows (can
you print to that printer from others windows applications) ?
> If yes,
then you can use:
> Printer.SetPrinter('Printer name');
> -Laco.
> 
>>
Em 16.12.2014 09:27, LacaK escreveu: 
>> 
>>> You can use:
>>>
Printer.RawMode := True;
>>> Printer.BeginDoc;
>>> 
>>>
Printer.EndDoc;
>>> -Laco.
>> 
>>> Thank you, but that the part I
already knew (saw it searching in Google).
>> The question is how to
select the USB port and create Printer ( win32/win
>> 
>>> 5px; width:
100%;">
>> px; margin-left: 5px; width: 100%;"> 
>> 
>> I need a
solution (unit?) to access printer (matricial li
>> 
>>> 32 or win64.

>>> 
>>> apreciate any ideia 
>>> 
>>> thanks 
>>> 
>>> Philippe 
>>>
-
>>> 
>>>
___
>>> fpc-pascal maillist
- fpc-pascal@lists.freepascal.org
>>>
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal [1]
>>>

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

>>> -
>>> 
>>>
___ fpc-pascal maillist -
fpc-pascal@lists.freepascal.org
>> eetext"
href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal";>http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>

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




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

Re: [fpc-pascal] raw printing throught USB port / WINDOWS

2014-12-16 Thread Philippe
 

Em 16.12.2014 09:27, LacaK escreveu: 

> You can use:
>
Printer.RawMode := True;
> Printer.BeginDoc;
> 
> Printer.EndDoc;
>
-Laco.

> Thank you, but that the part I already knew (saw it searching
in Google).
 The question is how to select the USB port and create
Printer ( win32/win64 ). 

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

[fpc-pascal] raw printing throught USB port / WINDOWS

2014-12-16 Thread Philippe
 

I need a solution (unit?) to access printer (matricial like LX80,
LX300 and so on) in raw mode throught USB port directly from FPC program
build in mode win32 or win64. 

apreciate any ideia 

thanks 

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

Re: [fpc-pascal] red( clGrayText)

2014-12-02 Thread Philippe
 

Em 01.12.2014 22:42, Mattias Gaertner escreveu: 

> On Mon, 01 Dec
2014 22:01:15 -0200
> Philippe  wrote:
> 
>>
[...] http://wiki.lazarus.freepascal.org/Colors#System_colors [1][1] 
>>

>>> I have seen it ... but did not catch that it may not work
>> with
red( x) ... making it more simple, it means that the range of values
used for those constants as clGrayText is not TColor compatible. Is that
correct?
> 
> clGrayText is a TColor, but TColor is not always a simple
RGB value.
> System colors are context sensitive.
> You might try
> 
>
Red(ColorToRGB(clGrayText));
> 
> Mattias
> 
> working fine !
> Thank
you.
> 
> ___
> fpc-pascal
maillist - fpc-pascal@lists.freepascal.org
>
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal [2]




Links:
--
[1]
http://wiki.lazarus.freepascal.org/Colors#System_colors
[2]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] red( clGrayText)

2014-12-01 Thread Philippe
 

Em 01.12.2014 20:04, Mattias Gaertner escreveu: 

> On Mon, 01 Dec
2014 15:17:04 -0200
> Philippe  wrote:
> 
>>
using -Cr (Range Check) option, red( clGrayText) as example, throw an
exception! how should I program "red" (or green, blue and may be some
others) functions to avoid that? should I write red( clGrayText and
$ff) ? ... another better way?
> 
> Have you read this?
>
http://wiki.lazarus.freepascal.org/Colors#System_colors [1]
> 
>
Mattias
> 
> I have seen it ... but did not catch that it may not work
with red( x) ... making it more simple, it means that the range of
values used for those constants as clGrayText is not TColor compatible.
Is that correct? 
> 
> ___
>
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
>
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal [2]




Links:
--
[1]
http://wiki.lazarus.freepascal.org/Colors#System_colors
[2]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] -CR option and simplehtmltreeparser

2014-12-01 Thread Philippe
 

compiling simplehtmltreeparser with -CR option I get:


F:lazaruscomponentsinternettoolsdatasimplehtmltreeparser.pas(591,13)
Error: Incompatible type for arg no. 2: Got "Class Of INamespace",
expected "TClass" 

here is the line .. 

function
TNamespaceList.getNamespace(i: integer): INamespace;
begin
 result :=
INamespace(inherited get(i)) ;
end; 

 it is difficulting to use the -CR
option  ___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] red( clGrayText)

2014-12-01 Thread Philippe
 

using -Cr (Range Check) option, red( clGrayText) as example, throw
an exception! 

how should I program "red" (or green, blue and may be
some others) functions to avoid that? 

should I write red( clGrayText
and $ff) ? ... another better way? 

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

Re: [fpc-pascal] date formating dificulty

2014-11-19 Thread Philippe
 

Em 19.11.2014 19:31, waldo kitty escreveu: 

> On 11/19/2014 9:17
AM, Philippe wrote:
> 
>>> I still don't know how to use at the same
time formatStr and FormatSettings in FormatDateTime.
> 
> i'm not sure i
understand your delima... perhaps you are trying to determine how 
> the
FormatSettings work and how you can force the same output format on 
>
different OSes? i found the following (slightly modified by me for CLI)
delphi 
> code that might help... the original code resides at 
>
http://www.delphibasics.co.uk/RTL.asp?Name=FormatDateTime [1]in the
code, we output the results of the various FormatDateTime usages... then

> we change the values of the date and time formatting variables and
run the same 
> outputs again...
> 
>>> I´ll like very much to find a
tutorial or some example about the good practice to manage dates and be
sure it will do the same thing on different machines 
> 
> in some
cases, you can fall back to delphi tutorials... it can be troublesome in

> some cases where things are slightly different between FPC/Lazarus
and Delphi... 
> the biggest problem i personally run into is that so
much example code is GUI 
> oriented and i still code for CLI...
> 
>
anyway, here is the output of the following code...
> 
> *NOTE:* i think
we've found a bug in (fpc?) trunk or perhaps it is just an 
> unexpected
side effect due to the system's settings... the day and month are 
>
reversed in the first separators line... as the comments in the code
note, we're 
> trying to work with 5 Jun 49... but this output was done
on a US winwhatever 
> (vista) system... it might be getting in the way
by forcing mm/dd/yy format from 
> the dd/mm/yy work string... someone
else will have to speak to that as i would 
> expect it to do the same
in the second output set but it doesn't...
> 
> System formatting:
>
Working with date string = 05/06/49 01:02:03.004
> Separators dd/mm/yy
hh:nn:ss = 06/05/49 01:02:03
> ShortMonths mmm = May
> LongMonths  =
May
> ShortDays ddd = Thu
> LongDays  = Thursday
> ShortDate d =
5/6/2049
> LongDate dd = Thursday, May 06, 2049
> AMPM hhampm =
01AM
> ShortTime t = 1:02
> LongTime tt = 1:02:03
> 2DigitCentury
dd/mm/ = 06/05/2049
> 
> Modified formatting:
> Working with date
string = 05-06-49 01_02_03.004
> Separators dd/mm/yy hh:nn:ss = 05-06-49
01_02_03
> ShortMonths mmm = JUN
> LongMonths  = JUNE
> ShortDays
ddd = SUN
> LongDays  = SUNDAY
> ShortDate d = 05-JUN-49
>
LongDate dd = SUNDAY 05 of JUNE of 1949
> AMPM hhampm = 01morning
>
ShortTime t = 01_02_03
> LongTime tt = 01 _ 02 _ 03 . 004
>
2DigitCentury dd/mm/ = 05-06-1949
> 
> = snip =
> program
DTFormatting;
> 
> uses SysUtils;
> 
> var
> DateStr : String;
> myDate
: TDateTime;
> 
> begin
> // Set up our TDateTime variable with a full
date and time :
> // 5th of June 2049 at 01:02:03.004 (.004
milli-seconds)
> //
> // Note that 49 is treated as 2049 as follows :
>
// TwoDigitYearCenturyWindow => 50
> // Current year => 2008 (at time of
writing)
> // Subtract TwoDigitYearCenturyWindow => 1958
> // 2 digit
year to be converted => 49
> // Compare with the last 2 digits of 1958
=> Less
> // So the year is in the next century => 2049
> // (58 would
be converted to 1958)
> 
> WriteLn('System formatting:');
> 
> DateStr
:= '05/06/49 01:02:03.004';
> WriteLn(' Working with date string =
'+DateStr);
> 
> myDate := StrToDateTime(DateStr);
> 
> // Demonstrate
default locale settings
> 
> // Use the DateSeparator and TimeSeparator
values
> WriteLn(' Separators dd/mm/yy hh:nn:ss =
'+FormatDateTime('dd/mm/yy 
> hh:nn:ss', myDate));
> 
> // Use
ShortMonthNames
> WriteLn(' ShortMonths mmm = '+FormatDateTime('mmm',
myDate));
> 
> // Use LongMonthNames
> WriteLn(' LongMonths  =
'+FormatDateTime('', myDate));
> 
> // Use ShortDayNames
> WriteLn('
ShortDays ddd = '+FormatDateTime('ddd', myDate));
> 
> // Use
LongDayNames
> WriteLn(' LongDays  = '+FormatDateTime('',
myDate));
> 
> // Use the ShortDateFormat string
> WriteLn(' ShortDate
d = '+FormatDateTime('d', myDate));
> 
> // Use the
LongDateFormat string
> WriteLn(' LongDate dd =
'+FormatDateTime('dd', myDate));
> 
> // Use the TimeAmString
>
WriteLn(' AMPM hhampm = '+FormatDateTime('hhampm', myDate));
> 
> // Use
the ShortTimeFormat string
> WriteLn(' ShortTime t =
'+FormatDateTime('t', myDate));
> 
>

Re: [fpc-pascal] date formating dificulty

2014-11-19 Thread Philippe
 

Em 19.11.2014 12:17, Philippe escreveu: 

> Em 18.11.2014 10:27,
Michael Van Canneyt escreveu: 
> 
>> On Tue, 18 Nov 2014, Philippe
wrote:
>> 
>>> Em 18.11.2014 09:49, Philippe escreveu: I wrote a
program: - windows 8 32 bits - lazarus 1.2.4 ... fpc 2.6.4 then I copied
it to another computer - windows 7 64 bits - lazarus 1.0.14  fpc
2.6.2 and got into trouble with dates format! programs behave diferent
way, and what was working on the fisrt computer does not work properly
in the second! I guess I need some tutorial (I looked for but did not
find anything :( !) why formatDateTime( 'DD/MM/', now) returns
18-11-2014 and not 18/11/2014 ? strtodate( formatDateTime( 'DD/MM/',
now)) works ok on the w 8 32 bits, but arise an exception on the w 7 64
bits. I am confused with the following syntax function FormatDateTime(
const FormatStr: string; DateTime: TDateTime; const FormatSettings:
TFormatSettings ):string; how does it work between two format
especifications: FormatStr and FormatSettings ? appreciate any example
of good programming pratise of data formating to avoid bad surprise
moving program from an OS to another ! Philippe on
http://www.freepascal.org/docs-html/rtl/sysutils/strtodate.html [1] I
found Program Example19; { This program demonstrates the StrToDate
function } Uses sysutils; Procedure TestStr (S : String); begin Writeln
(S,' : ',DateToStr(StrToDate(S))); end; Begin Writeln ('ShortDateFormat
',ShortDateFormat); TestStr(DateTimeToStr(Date));
TestStr('05'+DateSeparator+'05'+DateSeparator+'1999');
TestStr('5'+DateSeparator+'5'); TestStr('5'); End. the compiler warns
that ShortDateFormat is deprecated ... which is not informed in the doc
...
>> 
>> It should be, I will check.
>> 
>> Anyway, as Graeme hinted:
ShortDateFormat contains a format string, and / is a placeholder for the
date 
>> separator character on the computer on which the program is
running.
>> 
>> If you want to force a character, you can enclose it in
quotes:
>> ShortDateFormat:='dd"/"mm"/"'
>> will always use / as the
date separator, no matter what the internatonalization settings on the
PC.
>> 
>> But it is bad practice to do so.
>> 
>> Secondly, it is a
common mistake to think that StrToDate will always correctly perform the
opposite of DateToStr.
>> It does not, but this is documented.
>> 
>>
Michael.
>> 
>> I still don't know how to use at the same time formatStr
and FormatSettings in FormatDateTime.
>> 
>> I´ll like very much to find
a tutorial or some example about the good practice to manage dates and
be sure it will do the same thing on different machines 
>> 
>>
Thanks
>> 
>> interesting stuff ... but ... out of date using
deprecatings ... (from year 2000 !!!) ... does not help much!!!
>> 
>>
http://www.math.uni-leipzig.de/pool/tuts/FreePascal/units/node21.html#SECTION002141000
>>

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




Links:
--
[1]
http://www.freepascal.org/docs-html/rtl/sysutils/strtodate.html
[2]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] date formating dificulty

2014-11-19 Thread Philippe
 

Em 18.11.2014 10:27, Michael Van Canneyt escreveu: 

> On Tue, 18
Nov 2014, Philippe wrote:
> 
>> Em 18.11.2014 09:49, Philippe escreveu:
I wrote a program: - windows 8 32 bits - lazarus 1.2.4 ... fpc 2.6.4
then I copied it to another computer - windows 7 64 bits - lazarus
1.0.14  fpc 2.6.2 and got into trouble with dates format! programs
behave diferent way, and what was working on the fisrt computer does not
work properly in the second! I guess I need some tutorial (I looked for
but did not find anything :( !) why formatDateTime( 'DD/MM/', now)
returns 18-11-2014 and not 18/11/2014 ? strtodate( formatDateTime(
'DD/MM/', now)) works ok on the w 8 32 bits, but arise an exception
on the w 7 64 bits. I am confused with the following syntax function
FormatDateTime( const FormatStr: string; DateTime: TDateTime; const
FormatSettings: TFormatSettings ):string; how does it work between two
format especifications: FormatStr and FormatSettings ? appreciate any
example of good programming pratise of data formating to avoid bad
surprise moving program from an OS to another ! Philippe on
http://www.freepascal.org/docs-html/rtl/sysutils/strtodate.html [1] I
found Program Example19; { This program demonstrates the StrToDate
function } Uses sysutils; Procedure TestStr (S : String); begin Writeln
(S,' : ',DateToStr(StrToDate(S))); end; Begin Writeln ('ShortDateFormat
',ShortDateFormat); TestStr(DateTimeToStr(Date));
TestStr('05'+DateSeparator+'05'+DateSeparator+'1999');
TestStr('5'+DateSeparator+'5'); TestStr('5'); End. the compiler warns
that ShortDateFormat is deprecated ... which is not informed in the doc
...
> 
> It should be, I will check.
> 
> Anyway, as Graeme hinted:
ShortDateFormat contains a format string, and / is a placeholder for the
date 
> separator character on the computer on which the program is
running.
> 
> If you want to force a character, you can enclose it in
quotes:
> ShortDateFormat:='dd"/"mm"/"'
> will always use / as the
date separator, no matter what the internatonalization settings on the
PC.
> 
> But it is bad practice to do so.
> 
> Secondly, it is a common
mistake to think that StrToDate will always correctly perform the
opposite of DateToStr.
> It does not, but this is documented.
> 
>
Michael.
> 
> I still don't know how to use at the same time formatStr
and FormatSettings in FormatDateTime.
> 
> I´ll like very much to find a
tutorial or some example about the good practice to manage dates and be
sure it will do the same thing on different machines 
> 
> Thanks
>

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




Links:
--
[1]
http://www.freepascal.org/docs-html/rtl/sysutils/strtodate.html
[2]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] date formating dificulty

2014-11-18 Thread Philippe
 

Em 18.11.2014 10:27, Michael Van Canneyt escreveu: 

> On Tue, 18
Nov 2014, Philippe wrote:
> 
>> Em 18.11.2014 09:49, Philippe escreveu:
I wrote a program: - windows 8 32 bits - lazarus 1.2.4 ... fpc 2.6.4
then I copied it to another computer - windows 7 64 bits - lazarus
1.0.14  fpc 2.6.2 and got into trouble with dates format! programs
behave diferent way, and what was working on the fisrt computer does not
work properly in the second! I guess I need some tutorial (I looked for
but did not find anything :( !) why formatDateTime( 'DD/MM/', now)
returns 18-11-2014 and not 18/11/2014 ? strtodate( formatDateTime(
'DD/MM/', now)) works ok on the w 8 32 bits, but arise an exception
on the w 7 64 bits. I am confused with the following syntax function
FormatDateTime( const FormatStr: string; DateTime: TDateTime; const
FormatSettings: TFormatSettings ):string; how does it work between two
format especifications: FormatStr and FormatSettings ? appreciate any
example of good programming pratise of data formating to avoid bad
surprise moving program from an OS to another ! Philippe on
http://www.freepascal.org/docs-html/rtl/sysutils/strtodate.html [1] I
found Program Example19; { This program demonstrates the StrToDate
function } Uses sysutils; Procedure TestStr (S : String); begin Writeln
(S,' : ',DateToStr(StrToDate(S))); end; Begin Writeln ('ShortDateFormat
',ShortDateFormat); TestStr(DateTimeToStr(Date));
TestStr('05'+DateSeparator+'05'+DateSeparator+'1999');
TestStr('5'+DateSeparator+'5'); TestStr('5'); End. the compiler warns
that ShortDateFormat is deprecated ... which is not informed in the doc
...
> 
> It should be, I will check.
> 
> Anyway, as Graeme hinted:
ShortDateFormat contains a format string, and / is a placeholder for the
date 
> separator character on the computer on which the program is
running.
> 
> If you want to force a character, you can enclose it in
quotes:
> ShortDateFormat:='dd"/"mm"/"'
> will always use / as the
date separator, no matter what the internatonalization settings on the
PC.
> 
> But it is bad practice to do so.
> 
> Secondly, it is a common
mistake to think that StrToDate will always correctly perform the
opposite of DateToStr.
> It does not, but this is documented.
> 
>
Michael.

> Thanks for your answer. It is a good start.
 As you wrote it
is not a good pratice to do so. ... So I can repeat part of the
question! ... Where can I find tutorial wh

> solid; margin-left:5px;
width:100%">
> 
> 
al
maillist - fpc-pascal@lists.freepascal.org 

> 


Links:
--
[1]
http://www.freepascal.org/docs-html/rtl/sysutils/strtodate.html
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] date formating dificulty

2014-11-18 Thread Philippe
 

Em 18.11.2014 09:49, Philippe escreveu: 

> I wrote a program: 
> 
>
- windows 8 32 bits 
> 
> - lazarus 1.2.4 ... fpc 2.6.4 
> 
> then I
copied it to another computer 
> 
> - windows 7 64 bits 
> 
> - lazarus
1.0.14  fpc 2.6.2 
> 
> and got into trouble with dates format!
programs behave diferent way, and what was working on the fisrt computer
does not work properly in the second! 
> 
> I guess I need some tutorial
(I looked for but did not find anything :( !) 
> 
> why formatDateTime(
'DD/MM/', now) returns 18-11-2014 and not 18/11/2014 ? 
> 
>
strtodate( formatDateTime( 'DD/MM/', now)) works ok on the w 8 32
bits, but arise an exception on the w 7 64 bits. 
> 
> I am confused
with the following syntax 
> 
> function FormatDateTime( 
> 
> const
FormatStr: string; 
> 
> DateTime: TDateTime [2]; 
> 
> const
FormatSettings: TFormatSettings [3] 
> 
> ):string; 
> 
> how does it
work between two format especifications: FormatStr and FormatSettings ?

> 
> appreciate any example of good programming pratise of data
formating to avoid bad surprise moving program from an OS to another !

> 
> Philippe 
> 
> on
http://www.freepascal.org/docs-html/rtl/sysutils/strtodate.html 
> 
> I
found 
> 
> Program Example19;
> 
> { This program demonstrates the
StrToDate function }
> 
> Uses sysutils;
> 
> Procedure TestStr (S :
String);
> 
> begin
> Writeln (S,' : ',DateToStr(StrToDate(S)));
>
end;
> 
> Begin
> 
> Writeln ('ShortDateFormat ',ShortDateFormat);
>
TestStr(DateTimeToStr(Date));
>
TestStr('05'+DateSeparator+'05'+DateSeparator+'1999');
>
TestStr('5'+DateSeparator+'5');
> TestStr('5');
> End.
> 
> the compiler
warns that ShortDateFormat is deprecated ... which is not informed in
the doc ... 
> 
> ___
>
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
>
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal [1]




Links:
--
[1]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[2]
http://www.freepascal.org/docs-html/rtl/system/tdatetime.html
[3]
http://www.freepascal.org/docs-html/rtl/sysutils/tformatsettings.html
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] date formating dificulty

2014-11-18 Thread Philippe
 

I wrote a program: 

- windows 8 32 bits 

- lazarus 1.2.4 ... fpc
2.6.4 

then I copied it to another computer 

- windows 7 64 bits 

-
lazarus 1.0.14  fpc 2.6.2 

and got into trouble with dates format!
programs behave diferent way, and what was working on the fisrt computer
does not work properly in the second! 

I guess I need some tutorial (I
looked for but did not find anything :( !) 

why formatDateTime(
'DD/MM/', now) returns 18-11-2014 and not 18/11/2014 ? 

strtodate(
formatDateTime( 'DD/MM/', now)) works ok on the w 8 32 bits, but
arise an exception on the w 7 64 bits. 

I am confused with the
following syntax 

function FormatDateTime( 

 const FormatStr: string;


 DateTime: TDateTime [1]; 

 const FormatSettings: TFormatSettings [2]


):string; 

how does it work between two format especifications:
FormatStr and FormatSettings ? 

appreciate any example of good
programming pratise of data formating to avoid bad surprise moving
program from an OS to another ! 

Philippe 

Links:
--
[1]
http://www.freepascal.org/docs-html/rtl/system/tdatetime.html
[2]
http://www.freepascal.org/docs-html/rtl/sysutils/tformatsettings.html
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] fphttpclient and timeout

2014-10-24 Thread Philippe
 

Em 24.10.2014 09:54, silvioprog escreveu: 

> On Fri, Oct 24, 2014
at 8:41 AM, Michael Van Canneyt wrote: 
> 
>> On
Fri, 24 Oct 2014, Philippe wrote: 
>> 
>>> Using basically
HTTPClient.Get, I did not find time out configuration with fphttpclient.
Did I missed it?
>> 
>> it does not exist yet.
>> 
>>> If not, is there
a way to implement it ? Using thread?
>> 
>> that would be one way.
> 
>
You could implement the timeout directly in the internal FSocket in
TFPHttpClient(*). I implemented that using "GetTick"[1] and
"TTimeVal"[2]: 
> 
> Just suggestions! =) 
> 
> (*) E.g: 
> 
>
TFPCustomHTTPSocket = class(TInetSocket) // implementing the timout 
>
.. 
> 
> TFPCustomHTTPClient = Class(TComponent) 
> private 
> ... 
>
FSocket : TFPCustomHTTPSocket; // using TFPCustomHTTPSocket instead of
TInetSocket directly because TFPCustomHTTPSocket implements the timeout

> 
> [1] -
https://github.com/silvioprog/tcpipcomp/blob/master/src/tcpipbase.pas#L105
[1] 
> 
> [2] -
https://github.com/silvioprog/tcpipcomp/blob/master/src/tcpipclient.pas#L130
[2] 
> --
> Silvio Clécio
> My public projects - github.com/silvioprog
[3]

> Thanks ... may be a bit complicated for me now ... I keep it for
later!

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

> 


Links:
--
[1]
https://github.com/silvioprog/tcpipcomp/blob/master/src/tcpipbase.pas#L105
[2]
https://github.com/silvioprog/tcpipcomp/blob/master/src/tcpipclient.pas#L130
[3]
http://github.com/silvioprog
[4]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] fphttpclient and timeout

2014-10-24 Thread Philippe
 

Em 24.10.2014 09:41, Michael Van Canneyt escreveu: 

> On Fri, 24
Oct 2014, Philippe wrote:
> 
>> Using basically HTTPClient.Get, I did
not find time out configuration with fphttpclient. Did I missed it?
> 
>
it does not exist yet.
> 
>> If not, is there a way to implement it ?
Using thread?
> 
> that would be one way.

 

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

[fpc-pascal] fphttpclient and timeout

2014-10-24 Thread Philippe
 

Using basically HTTPClient.Get, I did not find time out
configuration with fphttpclient. Did I missed it? 

If not, is there a
way to implement it ? Using thread? 

If not, is there a similar
library/unit with configurable timeout? 

I appreciate any suggestion!


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

Re: [fpc-pascal] Free Pascal Directories

2014-10-03 Thread Philippe
imizing, see fpc -i for possible values
 -OW
Generate whole-program optimization feedback for optimization , see
fpc -i for possible values
 -Ow Perform whole-program optimization
, see fpc -i for possible values
 -Os Optimize for size rather than
speed
 -pg Generate profile code for gprof (defines FPC_PROFILE)
 -R
Assembler reading style:
 -Rdefault Use default assembler for target

-Ratt Read AT&T style assembler
 -Rintel Read Intel style assembler

-S Syntax options:
 -S2 Same as -Mobjfpc
 -Sc Support operators like
C (*=,+=,/= and -=)
 -Sa Turn on assertions
 -Sd Same as -Mdelphi

-Se Error options.  is a combination of the following:
  :
Compiler halts after the  errors (default is 1)
 w : Compiler also
halts after warnings
 n : Compiler also halts after notes
 h : Compiler
also halts after hints
 -Sg Enable LABEL and GOTO (default in -Mtp and
-Mdelphi)
 -Sh Use ansistrings by default instead of shortstrings
 -Si
Turn on inlining of procedures/functions declared as "inline"
 -Sk Load
fpcylix unit
 -SI Set interface style to 
 -SIcom COM compatible
interface (default)
 -SIcorba CORBA compatible interface
 -Sm Support
macros like C (global)
 -So Same as -Mtp
 -Ss Constructor name must be
init (destructor must be done)
 -Sx Enable exception keywords (default
in Delphi/ObjFPC modes)
 -Sy @ returns a typed pointer, same as
$T+
 -s Do not call assembler and linker
 -sh Generate script to link on
host
 -st Generate script to link on target
 -sr Skip register
allocation phase (use with -alr)
 -T Target operating system:

-Tdarwin Darwin/Mac OS X
 -Temx OS/2 via EMX (including EMX/RSX
extender)
 -Tfreebsd FreeBSD
 -Tgo32v2 Version 2 of DJ Delorie DOS
extender
 -Tiphonesim iPhoneSimulator from iOS SDK 3.2+ (older versions:
-Tdarwin)
 -Tlinux Linux
 -Tnetbsd NetBSD
 -Tnetware Novell Netware
Module (clib)
 -Tnetwlibc Novell Netware Module (libc)
 -Topenbsd
OpenBSD
 -Tos2 OS/2 / eComStation
 -Tsunos SunOS/Solaris
 -Tsymbian
Symbian OS
 -Tsolaris Solaris
 -Twatcom Watcom compatible DOS extender

-Twdosx WDOSX DOS extender
 -Twin32 Windows 32 Bit
 -Twince Windows CE

-u Undefines the symbol 
 -U Unit options:
 -Un Do not check where
the unit name matches the file name
 -Ur Generate release unit files
(never automatically recompiled)
 -Us Compile a system unit
 -v Be
verbose.  is a combination of the following letters:
 e : Show errors
(default) 0 : Show nothing (except errors)
 w : Show warnings u : Show
unit info
 n : Show notes t : Show tried/used files
 h : Show hints c :
Show conditionals
 i : Show general info d : Show debug info
 l : Show
linenumbers r : Rhide/GCC compatibility mode
 s : Show time stamps q :
Show message numbers
 a : Show everything x : Executable info (Win32
only)
 b : Write file names messages p : Write tree.log with parse tree

with full path v : Write fpcdebug.txt with
 lots of debugging info

m, : Don't show messages numbered  and 
 -W
Target-specific options (targets)
 -WA Specify native type application
(Windows)
 -Wb Create a bundle instead of a library (Darwin)
 -WB Create
a relocatable image (Windows, Symbian)
 -WB Set image base to 
(Windows, Symbian)
 -WC Specify console type application (EMX, OS/2,
Windows)
 -WD Use DEFFILE to export functions of DLL or EXE (Windows)

-We Use external resources (Darwin)
 -WF Specify full-screen type
application (EMX, OS/2)
 -WG Specify graphic type application (EMX,
OS/2, Windows)
 -Wi Use internal resources (Darwin)
 -WI Turn on/off the
usage of import sections (Windows)
 -WM Minimum Mac OS X deployment
version: 10.4, 10.5.1, ... (Darwin)
 -WN Do not generate relocation
code, needed for debugging (Windows)
 -WP Minimum iOS deployment
version: 3.0, 5.0.1, ... (iphonesim)
 -WR Generate relocation code
(Windows)
 -WX Enable executable stack (Linux)
 -X Executable options:

-Xc Pass --shared/-dynamic to the linker (BeOS, Darwin, FreeBSD, Linux)

-Xd Do not search default library path (sometimes required for
cross-compiling when not using -XR)
 -Xe Use external linker
 -Xg Create
debuginfo in a separate file and add a debuglink section to executable

-XD Try to link units dynamically (defines FPC_LINK_DYNAMIC)
 -Xi Use
internal linker
 -Xm Generate link map
 -XM Set the name of the
'main' program routine (default is 'main')
 -XP Prepend the binutils
names with the prefix 
 -Xr Set the linker's rlink-path to 
(needed for cross compile, see the ld manual for more information)
(BeOS, Linux)
 -XR Prepend  to all linker search paths (BeOS,
Darwin, FreeBSD, Linux, Mac OS, Solaris)
 -Xs Strip all symbols from
executable
 -XS Try to link units statically (default, defines
FPC_LINK_STATIC)
 -Xt Link with static libraries (-static is passed to
linker)
 -XX Try to smartlink units (defines FPC_LINK_SMART)

 -? Show
this help
 -h Shows this help without waiting

Em 03.10.2014 18:53, Sven
Barth escreveu: 

> Am 03.10.2014 03:37 schrieb "Philippe"
:
> >
> > @cfg
> >
> > I read abou

Re: [fpc-pascal] Free Pascal Directories

2014-10-02 Thread Philippe
 

@cfg 

I read about that option in a previous message of the thread
... clearly a better ideia!!! ... I´ll use it for sure! 

taking
advantage of the oportunity. when one type fpc in the command line,
he/she gets: 

D:psl9c9>fpc
Free Pascal Compiler version 2.6.4
[2014/03/06] for i386
Copyright (c) 1993-2014 by Florian Klaempfl and
others
c:FPC2.6.4bini386-Win32ppc386.exe [options]  [options]


and so one ... 

and if I did not missed it, there is nothing about
@cfg ! 

that is the reason while I never used it! 

Em 02.10.2014
19:36, Sven Barth escreveu: 

> Am 02.10.2014 22:25 schrieb "Philippe"
:
> >
> > bad ideia :
> >
> > (with windows we
have a limite from the command line size!) 
> 
> If you can't work with
8000 characters then simply use a cfg file and pass that. It's not as if
you change your paths every hour... 
> 
> Regards,
> Sven 
> 
>
___
> fpc-pascal maillist -
fpc-pascal@lists.freepascal.org
>
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal [1]




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

Re: [fpc-pascal] Free Pascal Directories

2014-10-02 Thread Philippe
 

bad ideia : 

(with windows we have a limite from the command line
size!) 

I copy recursively all the files from directories I need in a
unique directory ... then compile from it!!! 

ugly! ... may be ... but
it works !!! recursively!!! and it is quite fast to copy ... and I spent
time in other things!!! 

Em 02.10.2014 11:12, Brian escreveu: 

> Jonas
, thanks very much as I now see what is happening. 
> 
> FPC only
searches the specific directory and not any lower level
> directories.
In this case the unit called is in a lower level directory.
> 
> Is
there any way using Geany to add $UNITPATH directives in the main
program
> or path info in Geany so FPC is able to find the required
units?
> 
> Thanks
> Brian
> 
> --
> View this message in context:
http://free-pascal-general.1045716.n5.nabble.com/Free-Pascal-Directories-tp5720212p5720252.html
[1]
> Sent from the Free Pascal - General mailing list archive at
Nabble.com.
> ___
>
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
>
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal [2]




Links:
--
[1]
http://free-pascal-general.1045716.n5.nabble.com/Free-Pascal-Directories-tp5720212p5720252.html
[2]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Free Pascal Directories

2014-10-01 Thread Philippe
 

as for other points (for example "with" use/misuse) ... for me -Fu
recursive, "with" statement and others may be usefull tools ... not for
you! 

there no absolute answer! 

may be other people don't do the same
kind of job I do, or you do. may they they don't work the same way I do,
or you do! 

abraço! 

Philippe 

Em 01.10.2014 02:30, leledumbo
escreveu: 

>> That's not what Brian asked for. He asked whether he can
use multiple directories, not whether he can use them recursively. And
the former is definitely the case.
> 
> And indeed it's a disaster,
because you might to restructure your units
> directory if it works
recursively depending on how you layout it. Example:
> If under the same
directory you have units for all targets you want to
> support, it's a
hell after -Fu works recursively.
> 
> --
> View this message in
context:
http://free-pascal-general.1045716.n5.nabble.com/Free-Pascal-Directories-tp5720212p5720226.html
[1]
> Sent from the Free Pascal - General mailing list archive at
Nabble.com.
> ___
>
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
>
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal [2]




Links:
--
[1]
http://free-pascal-general.1045716.n5.nabble.com/Free-Pascal-Directories-tp5720212p5720226.html
[2]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Free Pascal Directories

2014-09-30 Thread Philippe
 

some days before we had same type of thread ... 

the "problem" is


-Fu is not recursive! 

Em 30.09.2014 11:07, Michael Van Canneyt
escreveu: 

> On Tue, 30 Sep 2014, Brian wrote:
> 
>> Having ported a
large real-time graphical application from Virtual Pascal (DPMI) to Free
Pascal Linux , there is one aspect I haven't managed to overcome. For a
number of reasons Lazarus was not used , and Geany is used as the IDE ,
which works well. Unlike Virtual Pascal which allowed me to put
different code in separate directories , Free Pascal seems to want ALL
unit files in one huge directory which makes it difficult to keep proper
revision control.
> 
> Where did you get this idea from ?
> 
>> For
example if I decide to use fpGUI , I would like to put all the fpGUI
source code into one directory and the actual application (my code) in a
separate directory. Any suggestions ?
> 
> You can perfectly do this,
all my code is scattered over multiple directories.
> All you need to do
is add -Fu options.
> 
> Michael.
>
___
> fpc-pascal maillist -
fpc-pascal@lists.freepascal.org
>
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal [1]




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

Re: [fpc-pascal] Hack for C-like macro functions — will it work in future?

2014-09-24 Thread Philippe
 

and I am with 2.6.4  

thanks! 

Em 24.09.2014 07:28, Mattias
Gaertner escreveu: 

> On Wed, 24 Sep 2014 07:12:44 -0300
> Philippe
 wrote:
> 
>> -OoREMOVEEMPTYPROCS interesting!
why is it not available in Lazarus through "all options" window (in
project options / customizable options)?
> 
> It is available under
Compiler Options / Other / All Options 
> You need fpc 2.7.1 for
this.
> 
> Mattias
> ___
>
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
>
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal [1]




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

Re: [fpc-pascal] Hack for C-like macro functions — will it work in future?

2014-09-24 Thread Philippe
 

-OoREMOVEEMPTYPROCS 

interesting! 

why is it not available in
Lazarus through "all options" window (in project options / customizable
options)? 

(not sure about the names ... I have "opções personalizadas"
and "todas as opções"!) 

Philippe 

Em 24.09.2014 06:17, Sven Barth
escreveu: 

> Am 24.09.2014 10:15 schrieb "Tomas Hajny"
:
> > However, the trunk compiler offers also another
option, although it may or
> > may not be usable for you. In particular,
take the following:
> >
> > -
> > var
> > S2: string;
> >
> >
procedure Log (S: string);
> > begin
> > {$IFDEF TEST}
> > WriteLn
(S);
> > {$ENDIF TEST}
> > end;
> >
> > begin
> > ReadLn (S2);
> > Log
('Input = ' + S2);
> > end.
> > =
> >
> > If this is compiled
with trunk compiler using -OoREMOVEEMPTYPROCS (without
> > -dTEST),
procedure Log is not called at all and the concatenation of
> > strings
in its parameter is skipped as well. 
> 
> Another possibility would be
to define Log() as "inline", which should get rid of the call and maybe
the concatenation as well and already works in 2.6.x (though "array of
const" would not be supported if needed) 
> 
> Regards,
> Sven 
> 
>
___
> fpc-pascal maillist -
fpc-pascal@lists.freepascal.org
>
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal [1]




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

Re: [fpc-pascal] with statement using mulltiple objects

2014-09-17 Thread Philippe
 

(tout excusé!)  

Em 17.09.2014 21:45, Flávio Etrusco escreveu:


> On Wed, Sep 17, 2014 at 4:38 AM, Frederic Da Vitoria
>
 wrote:
> 
>> 2014-09-17 3:11 GMT+02:00 Flávio
Etrusco : 
>> 
>>> On Tue, Sep 16, 2014 at
8:09 PM, Philippe  wrote: 
>>> 
>>>> on compiler
implementation: I read in this list that the group lost months due a
"with" problem. People use "with", and I guess lot of people use it! I
checked the reference
http://www.freepascal.org/docs-html/ref/refsu58.html#x155-16500013.2.8
[1] and there is not any warning ... just: The statement With A,B,C,D do
Statement; is equivalent to With A do With B do With C do With D do
Statement; without any warning ...
>>> (...) Why would it? As people
replied in your thread, this has always been the behavior (at least in
TP and Delphi), so if anything the only thing lacking is some minor
documentation. Also please don't hijack threads.
>> I guess different
communities have different rules, but I don't understand (and I'd better
understand if I don't want to do the same mistake): in what way was
Philippe's post hijacking? This question goes to Philippe too, as he
wrote "we may be out of subject" which shows he felt something wrong. --
Frederic Da Vitoria (davitof)
> 
> The mistake was actually mine :-$ I
had deleted part of the thread and
> didn't realize this was the old
thread.
> Sorry Phillippe, and sorry for the noise everybody.
> 
>
-Flávio
> ___
> fpc-pascal
maillist - fpc-pascal@lists.freepascal.org
>
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal [2]




Links:
--
[1]
http://www.freepascal.org/docs-html/ref/refsu58.html#x155-16500013.2.8
[2]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] with statement using mulltiple objects

2014-09-16 Thread Philippe
 

sorry ... hijacking is not my intention ... sorry. 

Em 16.09.2014
22:11, Flávio Etrusco escreveu: 

> On Tue, Sep 16, 2014 at 8:09 PM,
Philippe  wrote:
> 
>> on compiler
implementation: I read in this list that the group lost months due a
"with" problem. People use "with", and I guess lot of people use it! I
checked the reference
http://www.freepascal.org/docs-html/ref/refsu58.html#x155-16500013.2.8
[1] and there is not any warning ... just: The statement With A,B,C,D do
Statement; is equivalent to With A do With B do With C do With D do
Statement; without any warning ...
> 
> (...)
> 
> Why would it? As
people replied in your thread, this has always been
> the behavior (at
least in TP and Delphi), so if anything the only
> thing lacking is some
minor documentation.
> Also please don't hijack threads.
> 
> -Flávio
>
___
> fpc-pascal maillist -
fpc-pascal@lists.freepascal.org
>
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal [2]




Links:
--
[1]
http://www.freepascal.org/docs-html/ref/refsu58.html#x155-16500013.2.8
[2]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] with statement using mulltiple objects

2014-09-16 Thread Philippe
 

on compiler implementation: 

I read in this list that the group
lost months due a "with" problem. 

People use "with", and I guess lot
of people use it! 

I checked the reference
http://www.freepascal.org/docs-html/ref/refsu58.html#x155-16500013.2.8
and there is not any warning ... just: 

The statement 
With A,B,C,D do
Statement; 

is equivalent to 
With A do 
 With B do 
 With C do 
 With
D do Statement; 

without any warning ... 

(and there is noting about
the syntax with xxx[ nn]^ = A do ... describe by someone earlier) 

I am
not telling that an implementation in the compiler should be of higher
priority!!! I appreciate a lot the great job that has been done, and is
still going on! I know I won't be able to do it!!! I'ld really like to
contribute ... but ... my age and qualification ... won't help very
much!!! 

But I am pretty sure that this implementation could have saved
many time to many people (as one of the developper wrote) ... and still
may save. 

But as it has been written ... we may be out of subject!


Philippe 

Em 16.09.2014 11:08, Ewald escreveu: 

> On 09/16/2014
03:41 PM, Philippe wrote:
> 
>> I imagine that who really want to get
rid from the hint ... don´t use Pascal anyway! or do have strong test
tools!!! one point is that (many?) people use "with" ... and compiler
can make it safer. may be as described Frederic Da Vitoria ... producing
error when may be confused. (but let configure it!)
> 
> The issue is
that when you introduce this hint, it is almost certain
> that someone
will ask `how to disable that hint?` on this list.
> 
> IMO it would be
a waste of time to implement such a thing. If I were a
> developer (hmm,
actually I am one :-) ), and I would work on a project
> like FPC
(meaning: in my free time, not getting paid to do the job), I
> would
invest my time in something that actually means something, like
> fixing
a bug, optimizing the RTL for a specific target, writing
>
documentation, etc... We are programmers after all, not end users who
>
want to be treated with silken gloves.
> 
> You've only got 10 choices
really: either you like the `with` statement,
> or you don't. In the
latter case don't use it. Remember that the
> original question was
about functionality, what this thread has now
> evolved into is, in my
opinion, off-topic.

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

Re: [fpc-pascal] with statement using mulltiple objects

2014-09-16 Thread Philippe
 

I imagine that who really want to get rid from the hint ... don´t
use Pascal anyway! or do have strong test tools!!! 

one point is that
(many?) people use "with" ... and compiler can make it safer. may be as
described Frederic Da Vitoria ... producing error when may be confused.
(but let configure it!) 

Philippe 

Em 16.09.2014 09:48, Frederic Da
Vitoria escreveu: 

> 2014-09-16 14:42 GMT+02:00 Sven Barth
:
> 
>> Am 16.09.2014 12:37 schrieb
"Mattias Gaertner" :
>> >
>> > On Tue, 16 Sep
2014 07:26:24 -0300
>> > Philippe  wrote:
>>
>
>> > >
>> > >
>> > > could the compiler avoid "with" pitfalls?
>> >
>
>> > > now the compiler attach
>> > > a property to the closest "with"
where it finds it.
>> > >
>> > > the compiler could
>> > > check if the
property appears in another "with" of the "with" stack and
>> > >
produce a message (hint, warning or error, which may be
configurated).
>> > >
>> > >
>> > > is not it a way to make the "with"
safe?
>> >
>> > How to get rid of the hint? 
>> 
>> Either get rid of
the "with" or use a compiler directive to disable it ;) 
>> 
>>
Regards,
>> Sven
> ... or rewrite the offending reference so that the
compiler won't complain.
> 
> -- Frederic Da Vitoria
> (davitof)
> 
>
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org [2] 
> 
>
___
> fpc-pascal maillist -
fpc-pascal@lists.freepascal.org
>
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal [1]




Links:
--
[1]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[2]
http://www.april.org
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] with statement using mulltiple objects

2014-09-16 Thread Philippe
 

could the compiler avoid "with" pitfalls? 

now the compiler attach
a property to the closest "with" where it finds it. 

the compiler could
check if the property appears in another "with" of the "with" stack and
produce a message (hint, warning or error, which may be configurated).


is not it a way to make the "with" safe? 

Em 16.09.2014 05:44,
Frederic Da Vitoria escreveu: 

> 2014-09-14 16:23 GMT+02:00 Mark Morgan
Lloyd :
> 
>> I'd be far happier if
there were provision for declaring a temporary "shortcut" symbol:
>> 
>>
with shortcut: TSomething= TreeRoot.SubDirs[Low(TreeRoot.SubDirs)]^
do
>> begin
>> shortcut.DirLogged := true;
>> shortcut.DirHatFocus :=
false;
>> shortcut.SubDirsExpanded := true;
> 
> Yes, something close to
alias in SQL, instead of plain elision which "with" currently performs.
This would allow for a clearer writing without the pitfalls of the
Pascal "with".
> 
> -- 
> Frederic Da Vitoria
> (davitof)
> 
> Membre de
l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org [2] 
> 
>
___
> fpc-pascal maillist -
fpc-pascal@lists.freepascal.org
>
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal [1]




Links:
--
[1]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[2]
http://www.april.org
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] with statement using mulltiple objects

2014-09-14 Thread Philippe
 

someone wrote about a better performance using "with". is that true?
even with a simple pointer as in: 

with ptr^ do 

begin 

prop1 := ...


prop2 := ... 

end; 

which should be faster then 

ptr^.prop1 := ...


ptr^.prop1 := ... 

others wrote it is just usefull to save writing
time ... 

Em 14.09.2014 12:40, Luca Olivetti escreveu: 

> El 14/09/14
17:20, Marco van de Voort ha escrit:
> 
>> In our previous episode,
Martin Schreiber said: 
>> 
 basically stopped using it.
>>> Why
does Free Pascal not invent a safe "with" similar as the "with" of
MSElang?
>> The primary question is of course if there is a need for a
new construct at all. I don't know MSELang, but many new languages try
to add new baroque constructs in a desperate attempt to draw users. I
always found that doubtful.
> 
> I replied this morning about TI pascal
(ca.1979), but for some reason I
> don't see it in the list.
> 
>
Anyway
> 
>
https://archive.org/stream/bitsavers_titm990100_41473222/MP351_MPP_UsersManual#page/n183/mode/2up
[1]
> 
> Bye

 

Links:
--
[1]
https://archive.org/stream/bitsavers_titm990100_41473222/MP351_MPP_UsersManual#page/n183/mode/2up
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] with statement using mulltiple objects

2014-09-14 Thread Philippe
 

main problem seems to be using property whose name is common within
2 objects of the same "with" (or code within several "with") 

could it
be controlled by a compiler option? 

in that case compiler may return a
hint or warning or even an error depending of the choosen configuration
... 

does this turn it safe, or safer? 

Philippe 

Em 14.09.2014
12:06, Martin Schreiber escreveu: 

> On Sunday 14 September 2014
16:34:06 Marco van de Voort wrote:
> 
>> In the past I had the same
opinion about with (WITHs evilness is exaggerated) as many others, but
once I bumped my head a few times while using OO frameworks that were
either not of my design or very large, I basically stopped using it.
>

> Why does Free Pascal not invent a safe "with" similar as the "with"
of 
> MSElang? If I would be cynical I could write "because one must
wait until 
> Delphi has it?". ;-)
> 
> Martin
>
___
> fpc-pascal maillist -
fpc-pascal@lists.freepascal.org
>
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal [1]




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

Re: [fpc-pascal] with statement using mulltiple objects

2014-09-14 Thread Philippe
 

-1. !!! 

I like "with" ... even it may give trouble times to
times!!! ... but I work alone on my programs ... 

as always ... nothing
perfect!  always should consider the conditions!! 

Em 14.09.2014
09:30, Michael Thompson escreveu: 

>> We have spend weeks (if not
months) off hunting down this kind of bugs.
>> And its this kind of bug
what showed up frequently in teams of
>> programmers and that made us
decide to ban the with statement as much
>> as possible. Sooner or later
the with stament is going to bite you, I
>> just hope you wont have to
spend that much time on resolving it ;( 
> 
> +1. With statement was
banned at my old job as well for exactly the reasons stated (by everyone
:) ) 
> 
> Mike 
> 
> ___
>
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
>
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal [1]




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

Re: [fpc-pascal] Elegant way to switch sort mechanism in TSortedCollection?

2014-03-12 Thread Philippe
 

solution may depend on the way the collection is used. load once?
many inserts and deletes? ... the time you have to switch from one sort
to another ... and the size of the collection ... 

you could 

- store
the actual collection to a TMemoryStream, 

- destroy the collection,


- Load then a new collect to be sort with different method ...


2014-03-12 21:56 GMT+01:00 Jim Leonard :Em
12.03.2014 19:06, Frederic Da Vitoria escreveu: 

>> On 3/12/2014 2:30
PM, Philippe wrote:
>> 
>>> Type
>>> TMethod = ( method_type_1,
method_type_2, method_type_3);
>> 
>> Ah, clever -- create a Compare
that switches based on what I tell it to do. I like that, but as far as
I can tell there's no way to tell a TSortedCollection to "resort" --
it's kept sorted only through inserts and deletes.
> You (or the user)
will never need to resotre the first order? I am asking because you
could as well simply create one SortedCollection for each sort order and
systematically insert each item in all those collections. The overhead
would be in the initial loading, but then switching would be
instantaneous. 
> 
> -- 
> Frederic Da Vitoria
> (davitof)
> 
> Membre
de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org [2] 
> 
>
___
> fpc-pascal maillist -
fpc-pascal@lists.freepascal.org
>
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal [1]




Links:
--
[1]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[2]
http://www.april.org
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Elegant way to switch sort mechanism in TSortedCollection?

2014-03-12 Thread Philippe
 

using the example at
http://acm.msu.ru/mkoshp/fpc/rtl/objects/tsortedcollection.html 

may
something this way ... 

Type
TMethod = ( method_type_1, method_type_2,
method_type_3); 

PMySortedCollection = ^TMySortedCollection;
TMySortedCollection = Object(TSortedCollection)
 method : TMethod;

Function Compare (Key1,Key2 : Pointer): Sw_integer; virtual; 
 procedure
setMethod( const m : TMethod);
end; 

Implementation 

Uses MyObject;


Function TMySortedCollection.Compare (Key1,Key2 : Pointer)
:sw_integer; 

begin 
 case method of

 method_type_1:
Compare:=PMyobject(Key1)^.GetField - PMyObject(Key2)^.GetField;


method_type_2: Compare:=PMyobject(Key2)^.GetField -
PMyObject(Key1)^.GetField;

 method_type_3:
Compare:=PMyobject(Key1)^.GetField - 2 * PMyObject(Key2)^.GetField; 


end;
end;

procedure TMySortedCollection.setMethod( const m :
TMethod);

begin 

 method := m; 

  

end; 

Em 12.03.2014 15:51,
Jim Leonard escreveu: 

> I'm working on a project that utilizes a
TSortedCollection to help keep 
> items sorted during processing. There
is a need to re-sort the 
> collection by different criteria on-demand
as the program runs. 
> (Different sort orders are an integral part of
the processing.)
> 
> Unless I'm missing something, TSortedCollection
lacks the ability to 
> change the Compare method after initialization
and/or explicitly re-sort 
> the collection on-demand. I was planning on
handling each new (re)sort by:
> 
> 1. Initializing a new
TSortedCollection with the desired Compare method
> 2. Copying the
contents from the old collection to the new one
> 3. Swap collection
pointers; destroy the old collection.
> 
> This works without much
penalty because the collection will never get 
> beyond a reasonable
size, but the implementation makes me cringe. Is 
> there a more elegant
way to do this (without writing my own sort 
> routines for a plain
TCollection)?

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

Re: [fpc-pascal] freepascal community and USB printing

2014-02-07 Thread Philippe
 

no problem ... may be could be informed at the messages bottom ...
"new topic: create a new message ..." 

Em 06.02.2014 22:47, waldo kitty
escreveu: 

> On 2/6/2014 2:45 PM, Philippe wrote:
> 
>> so ... sorry
again (I didn´t know it could make a difference) ...
> 
> thanks and no
problem... frederic's explanation is accurate... one should also 
>
think about news groups and their readers... the Message-ID and
References lines 
> of each post are used to build the topic trees and
the links between messages to 
> create the threading... this is much
better than the old "subject linking" style 
> that was (still is in
some cases) used on the old original BBSes...
> 
> i do apologize if i
sounded harsh or ugly... this happens more than you might 
> think ;)
>

>> Em 06.02.2014 15:59, waldo kitty escreveu: 
>> 
>>> On 2/6/2014 9:24
AM, Philippe wrote: 
>>> 
>>>> searching for raw printing to usb printer
... I found that some stuff has been posted in the community forum ...
which looks to be out of order ... is there a way to get the
informations posted ...
>>> and you did it (hijacked the same thread
with another topic) again :/

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

Re: [fpc-pascal] freepascal community and USB printing

2014-02-06 Thread Philippe
 

thanks ... I´ll take care of it ... 

Em 06.02.2014 20:27, Frederic
Da Vitoria escreveu: 

> It depends on the reader's mail client. Each
mail has a unique ID. When you chose to answer to a mail, your answer
contains the ID of the original mail too. If you change the subject,
this ID chain remains. This allows some mail clients (for example
Thunderbird) to show the mails in a tree structure, like on a forum. 
>

> 2014-02-06 Philippe :
> 
>> so ... sorry
again (I didn´t know it could make a difference) ... 
>> 
>> Em
06.02.2014 15:59, waldo kitty escreveu: 
>> 
>>> On 2/6/2014 9:24 AM,
Philippe wrote:
>>> 
>>>> searching for raw printing to usb printer ...
I found that some stuff has been posted in the community forum ... which
looks to be out of order ... is there a way to get the informations
posted ...
>>> 
>>> and you did it (hijacked the same thread with
another topic) again :/
>> 
>>
___
>> fpc-pascal maillist -
fpc-pascal@lists.freepascal.org
>>
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal [1]
> 
>
-- 
> Frederic Da Vitoria
> (davitof)
> 
> Membre de l'April - «
promouvoir et défendre le logiciel libre » - http://www.april.org [2] 
>

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




Links:
--
[1]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[2]
http://www.april.org
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] freepascal community and USB printing

2014-02-06 Thread Philippe
 

so ... sorry again (I didn´t know it could make a difference) ...


Em 06.02.2014 15:59, waldo kitty escreveu: 

> On 2/6/2014 9:24 AM,
Philippe wrote:
> 
>> searching for raw printing to usb printer ... I
found that some stuff has been posted in the community forum ... which
looks to be out of order ... is there a way to get the informations
posted ...
> 
> and you did it (hijacked the same thread with another
topic) again :/

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

Re: [fpc-pascal] windows title

2014-02-06 Thread Philippe
 

sorry ... I´ll do it next time ... 

Em 06.02.2014 15:58, waldo
kitty escreveu: 

> On 2/6/2014 9:16 AM, Philippe wrote:
> 
>> compiling
for targets win32 and win64, I´ld like to change the window title, the
window opened by cmd.exe
> 
> please do not hijack other people's topics
to ask an unrelated question... use 
> your 'write' or 'new message'
button instead of 'reply' to start a your new 
> topic... thanks!

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

Re: [fpc-pascal] windows title

2014-02-06 Thread Philippe
 

just simple like that ... works perfectly as I need ... 

I had
searched (but searching "freepascal") and found something ... more
complicated ... 

thank´s a lot. 

Philippe 

Em 06.02.2014 12:29, Tomas
Hajny escreveu: 

> On Thu, February 6, 2014 15:16, Philippe wrote:
>

>> compiling for targets win32 and win64, I´ld like to change the
window title, the window opened by cmd.exe program x; uses ?; begin
y( 'MY TITLE'); end. I didn´t find anything in the windows unit

> 
> Google suggests that Windows.SetConsoleTitle should do it
>
(https://www.google.com/search?q=MSDN+change+console+window+title
[1]).
> 
> Tomas
> 
> ___
>
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
>
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal [2]




Links:
--
[1]
https://www.google.com/search?q=MSDN+change+console+window+title
[2]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] freepascal community and USB printing

2014-02-06 Thread Philippe
 

searching for raw printing to usb printer ... I found that some
stuff has been posted in the community forum ... which looks to be out
of order ... is there a way to get the informations posted ... 

or may
be someone could tell me how to raw print to usb (as for LPT1), for
exemple to Epson LX 80. 

I am using fpc 2.6.2 targetting win32 and
win64. 

(with Lazarus it seems it can be done using printer unit ...
can I use it "directly"? ) 

Thanks for all 

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

Re: [fpc-pascal] windows title

2014-02-06 Thread Philippe
compiling for targets win32 and win64, I´ld like to change the window 
title, the window opened by cmd.exe


program x;
uses ?;
begin
 y( 'MY TITLE');
end.

I didn´t find anything in the windows unit 

Thanks for help!
Philippe
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Optimisation : X+X or 2*X or X*2 ?

2014-01-19 Thread Philippe
 

forgot 

X shl 1 

normaly the fastest ... 

Em 19.01.2014 17:47,
Ched escreveu: 

> Dear Freepascalers,
> 
> The multiplication in
floating arthmetic units is usualy know as being slower than the
addition. So, have 
> I interest to code X+X, 2*X or X*2 when using
reals (mainly double and extended) ?And with integers ?
> 
> Can the
compiler optimise this operation choosing the fastest one - probably
depending on the 
> architecture x86, arm, aso.
> 
> Cheers, Raoul
>
___
> fpc-pascal maillist -
fpc-pascal@lists.freepascal.org
>
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal [1]




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

Re: [fpc-pascal] win64 / zipper & fphttpclient

2014-01-17 Thread Philippe
 

I have implemented web access and unzipping of archives in my
program. Compiling perfectly targetting win32. 

But when I wanted to
mail a win64 version ... using ppcrossx64 ... it did not find zipper &
fphttpclient units ... 

Could anyone tell me how to make those units
(and related ones if any) available for ppcrossx64? 

Thanks 

Philippe
S. Lévi ___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Re: build a compiler for GO32v2 under Windows 8 (or 7)

2013-10-08 Thread Philippe
  

really thanks, but my needs are quite basic, and I found my way. 


but I keep the link ... me be usefull later! 

Thanks 

Philippe 

On
Tue, 8 Oct 2013 06:07:44 -0500, Michal Wallace wrote: 

> On Oct 5, 2013
2:34 PM, "Philippe" wrote:
> 
> > Problem!(?) ... I was using window,
gotoxy and so on ... and I don´t find anything similar with video unit!

> 
> I don't know if this would be useful to you, but I've been working
on a modernized CRT for some time: 
> 
> -
https://github.com/tangentstorm/xpl/blob/master/code/kvm.pas [2]
> -
http://tangentstorm.github.io/xpl/kvm.pas.html [3] ( literate
programming style tour of the code ) These support unicode output, 256
foreground and background colors, and (eventually) italics, bold, etc.
>

> They don't work with the video unit or the normal windows console,
because neither provide the above features.
> 
> However, I also have
implementations for SDL and ZenGL here:
> 
> -
https://github.com/sabren/b4/blob/master/ng/rxgl_sdl.pas [4]
> -
https://github.com/sabren/b4/blob/master/ng/rxgl_zen.pas [5]
> -
https://github.com/sabren/b4/blob/master/ng/rt_term.pas [6]
> 
> These
allow mixing console text with vector graphics powered by aggpas. 
>
Looks like I haven't declared that they implement the kvm interfaces
yet, but they should be very similar.
> 
> All of this is MIT-licensed
so feel free to do whatever with it. 
> 
> -Michal
>
http://tangentstorm.com/ [7]
 

Links:
--
[1]
mailto:phili...@quarta.com.br
[2]
https://github.com/tangentstorm/xpl/blob/master/code/kvm.pas
[3]
http://tangentstorm.github.io/xpl/kvm.pas.html
[4]
https://github.com/sabren/b4/blob/master/ng/rxgl_sdl.pas
[5]
https://github.com/sabren/b4/blob/master/ng/rxgl_zen.pas
[6]
https://github.com/sabren/b4/blob/master/ng/rt_term.pas
[7]
http://tangentstorm.com/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Re: build a compiler for GO32v2 under Windows 8 (or 7)

2013-10-06 Thread Philippe
  

it compiles and links ... still a lot of stuff to write and a bunch
to adjust 

first tests ... first suprises!!! 

but it compiles and
runs ... till the fisrt bug during first steps ... 

Philippe 

On Sat,
5 Oct 2013 22:48:09 +0200, Tomas Hajny wrote: 

> On Sat, October 5,
2013 21:34, Philippe wrote:
> 
>> I am back !!! (a bit sick ... teeth
...) I am now trying to move to win32. At first leaving crt unit, moving
to video unit. Problem!(?) ... I was using window, gotoxy and so on ...
and I don´t find anything similar with video unit!
> 
> First of all,
what do you try to solve by moving from unit Crt to unit
> Video? I
suggested using unit video as a substitution of your original
> direct
access to video adapter memory. Partial alternative of GotoXY
> exists
in unit Video - there is SetCursorPos. However, there is no direct
>
support for Window and thus the addressing is in absolute coordinates,
not
> relative to the defined window. Using direct video memory access
(i.e.
> very low-level approach) together with high-level routines like
Window,
> etc., is a bit strange. Units Video and Crt are not very
compatible to
> each other at the moment, unfortunately (although the
incompatibility may
> not be as bad on Win32 as on some other
platforms). Nevertheless, you may
> try it. Otherwise, you'd need either
to create your own alternatives of
> Window, etc., based on unit Video,
or to avoid using the solution based on
> directly addressing video
memory/buffer.
> 
> Tomas
> 
>
___
> fpc-pascal maillist -
fpc-pascal@lists.freepascal.org [1]
>
http://lists.freepascal.org/mailman/listinfo/fpc-pascal [2]



Links:
--
[1] mailto:fpc-pascal@lists.freepascal.org
[2]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Re: build a compiler for GO32v2 under Windows 8 (or 7)

2013-10-05 Thread Philippe
  

I really assumed that I had to choice between video unit and crt
unit ... 

my old unit which interfaced the video must be updated to be
compiled for win32. 

I already though about to create my window
procedure and my gotoxy procedure ... this way I may not have to make a
lot of changes in my program. 

I missed SetCursorPos ... thanks a lot


My first step, anyway, is to verify it is compiling for win32! ...
later I´ll make more changes and all the adjustments. 

Philippe 

On
Sat, 5 Oct 2013 22:48:09 +0200, Tomas Hajny wrote: 

> On Sat, October
5, 2013 21:34, Philippe wrote:
> 
>> I am back !!! (a bit sick ... teeth
...) I am now trying to move to win32. At first leaving crt unit, moving
to video unit. Problem!(?) ... I was using window, gotoxy and so on ...
and I don´t find anything similar with video unit!
> 
> First of all,
what do you try to solve by moving from unit Crt to unit
> Video? I
suggested using unit video as a substitution of your original
> direct
access to video adapter memory. Partial alternative of GotoXY
> exists
in unit Video - there is SetCursorPos. However, there is no direct
>
support for Window and thus the addressing is in absolute coordinates,
not
> relative to the defined window. Using direct video memory access
(i.e.
> very low-level approach) together with high-level routines like
Window,
> etc., is a bit strange. Units Video and Crt are not very
compatible to
> each other at the moment, unfortunately (although the
incompatibility may
> not be as bad on Win32 as on some other
platforms). Nevertheless, you may
> try it. Otherwise, you'd need either
to create your own alternatives of
> Window, etc., based on unit Video,
or to avoid using the solution based on
> directly addressing video
memory/buffer.
> 
> Tomas
> 
>
___
> fpc-pascal maillist -
fpc-pascal@lists.freepascal.org [1]
>
http://lists.freepascal.org/mailman/listinfo/fpc-pascal [2]



Links:
--
[1] mailto:fpc-pascal@lists.freepascal.org
[2]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Re: build a compiler for GO32v2 under Windows 8 (or 7)

2013-10-05 Thread Philippe
  

I am back !!! (a bit sick ... teeth ...) 

I am now trying to move
to win32. At first leaving crt unit, moving to video unit. 

Problem!(?)
... I was using window, gotoxy and so on ... and I don´t find anything
similar with video unit! 

On Fri, 20 Sep 2013 11:02:00 +0200, Sven
Barth wrote: 

> Am 19.09.2013 22:46, schrieb Tomas Hajny:
> 
>> On Thu,
September 19, 2013 21:55, Sven Barth wrote: 
>> 
>>> On 19.09.2013
17:28, Tomas Hajny wrote:
>> . . 
>> 
 2) You still need at least a
linker for the GO32v2 target (FPC internal linker does not support this
target) and that is the somewhat tricky part.
>>> Hmm? Looking at
compiler/systems/t_go32v2.pas I would say GO32v2 does have an internal
linker?!
>> Have you checked it in fixes or trunk? In any case, I've
tried it directly with the 2.6.2 binary before posting - even if I pass
-Xi explicitly, the compiler still complains about go32v2-ld.exe not
found if it is not accessible (and linking fails). I believe that Sergei
may have fixed / enabled it for GO32v2 in trunk (but my memory may serve
me wrong, of course).
> 
> Ehm, yes, trunk only. Sergei implemented it
in revision 21435 at 30th 
> May 2012.
> 
> Regards,
> Sven
>
___
> fpc-pascal maillist -
fpc-pascal@lists.freepascal.org [1]
>
http://lists.freepascal.org/mailman/listinfo/fpc-pascal [2]



Links:
--
[1] mailto:fpc-pascal@lists.freepascal.org
[2]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Re: Problems reading some of the messages from this mailing list

2013-09-23 Thread Philippe
  

I changed the webmail configuration to MIME / 8 bits ... I hope it
helps! 

Philippe 

On Mon, 23 Sep 2013 15:06:00 +0200, Guillermo
Martínez wrote: 

> From: "Tomas Hajny" 
> 
>> That should not be an
issue by itself. The more likely reason is probably use of 8-bit message
(utf-8) without encoding in us-ascii (7-bit) compatible "envelope" -
typically MIME Quoted Printable (as already used for the HTML section,
but not for the plain text version). Some mail servers may not allow
that and recode the message in MIME Base64 encoding (which is most
likely the text below); while doing that, they should include this
information in the header, but I suspect that this hasn't happened in
the case of Guillermo (this could be checked if he forwards the received
message in attachment - doing this via fpc-other would be more
appropriate than here). Nevertheless, the real solution is probably for
Philippe to configure his e-mail client not to send 8-bit messages
without 7-bit "safe" encoding). Tomas
> 
> So I can't do anything, can
I?
> 
> Unfortunatelly there are more users that sends their e-mail that
way,
> specially chinese ones.
> 
> Thanks.
> Guillermo "Ñuño"
Martínez.
> ___
> fpc-pascal
maillist - fpc-pascal@lists.freepascal.org [2]
>
http://lists.freepascal.org/mailman/listinfo/fpc-pascal [3]



Links:
--
[1] mailto:xhaj...@hajny.biz
[2]
mailto:fpc-pascal@lists.freepascal.org
[3]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Re: build a compiler for GO32v2 under Windows 8 (or 7)

2013-09-23 Thread Philippe
  

sorry ... delayed answer ... I don´t felt very well these days 
and this subject is a bit difficult for me ... but I will give time this
week to read all I received ... and find out a way ... I´ll write later
this week 

any way, I thank you very much all for your help! 

Philippe


On Thu, 19 Sep 2013 22:01:50 +0200, Sven Barth wrote: 

> On
18.09.2013 18:48, Philippe wrote:
> 
>> (first time I am using the mail
list ... I may do it wrong!) I have a quite big program (now with more
than 200.000 lines), first build with TP7. For example it accesses CGA
memory through absolute address ... Years ago I moved to FPC. And it
compiled ok under Windows 98 then under XP. Now with with a new PC
running Windows 8 ... the compiler bugs. It works fine with small
program  but not with one which executable about 1.5 Mb large (which
is my case, I did not checked till which size it works!).
> 
> It's not
necessarily a problem of your executable size, but the problem 
> is the
size/amount of units, because when compiling the compiler needs 
> to
keep all their interface meta-data in RAM.
> 
>> My program should run
in prompt command window of any MS Windows version (compiling on XP
machine, the executable runs fine on MS Windows 8 machine)
> 
> This
will however not work on a 64-bit systems as the NT Virtual DOS 
>
Machine (ntvdm.exe) is not supported there anymore.

-- 
Philippe
 


Links:
--
[1] mailto:fpc-pascal@lists.freepascal.org
[2]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] Re: build a compiler for GO32v2 under Windows 8 (or 7)

2013-09-19 Thread Philippe
  

(first time I am using the mail list ... I may do it wrong!) 

I
have a quite big program (now with more than 200.000 lines), first build
with TP7. For example it accesses CGA memory through absolute address
...  

Years ago I moved to FPC. And it compiled ok under Windows 98
then under XP. 

Now with with a new PC running Windows 8 ... the
compiler bugs. It works fine with small program  but not with one
which executable about 1.5 Mb large (which is my case, I did not checked
till which size it works!). 

My program should run in prompt command
window of any MS Windows version (compiling on XP machine, the
executable runs fine on MS Windows 8 machine) 

The bug may not be fixed
soon ... version of the compiler for DOS/GO32v2 is not maintained any
more. 

through bug tracker I have been told to build the compiler this
way (using i386-win32 source and compiler):

cd c:fpc2.6.2-src
set
PATH=c:fpc2.6.2bini386-win32;%PATH%
make clean crossall crossinstall
CPU_TARGET=i386 OS_TARGET=go32v2 BINUTILSPREFIX=
INSTALL_PREFIX=c:fpc2.6.2 FPMAKEOPT="-T 2" 

but this does not build the
fpc.exe 

it does build go32v2 units in the  FPC2.6.2UNITSGO32V2 

I
tried to compile the software for win32 (not GO32v2) ... but I got an
error on the absolute address syntaxe ... then I tried to use {$mode TP}
in the unit where is the absolute address ( TelaCGA : Telas absolute
$B800:;) ... but it looks like that {$mode ...} does not work as
expected. It should be for the current unit ... but ... but next units
does not compile any more ... may be because of related units
...

through bug tracker I got these informations which let me think
that the job is not simple as I expected:

I BELIEVE THAT THE
CROSS-COMPILER SHOULD NOT BE NECESSARY AND USING THE WIN32 COMPILER
DIRECTLY SHOULD BE A BETTER OPTION (even if running under 64-bit Windows
as long as I understand it correctly). Obviously, the RTL and packages
compiled for GO32v2 are necessary, but these may be installed from our
standard FPC release for GO32v2 (as long as using the same release of
the Windows compiler, of course), and SOME ADDITIONAL TRICKS MAY BE
NECESSARY (e.g. copying the DJGPP assembler and linker to the Win32
directory with the prefix expected by FPC), but otherwise it isn't that
difficult.

It´s quite easy to understand that it is not enough to find
out my way! 

where can I find documentation about the compiler and how
to build it?

I appreciate any help.

-- 

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

Re: [fpc-pascal] Generating code form xmi files

2009-04-05 Thread Philippe Martinole
It seem there is nothing available. If it is confirmed, I'll try to 
write something.

I'll have a lot of time because I'm stoping World of Wordcraft :)

Philippe


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


Re: [fpc-pascal] Generating code form xmi files

2009-04-02 Thread Philippe Martinole



Do you know if some code allready exist to generate Pascal code form xmi
files ?


What do you mean by generating Pascal code from xml files? Pascal code 
describes an algorithm, while xml files usually describe data.

xmi files (not xml) are used to save uml models :
http://en.wikipedia.org/wiki/XML_Metadata_Interchange
and I want to gererate my data structures from my uml diagrams
I would be suprised if nothing already exists

Philippe


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


[fpc-pascal] Generating code form xmi files

2009-04-02 Thread philippe . martinole

Do you know if some code allready exist to generate Pascal code form xmi
files ?

Best regards

Philippe



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