[Lazarus] PopupMenue Editor --> Access Violation

2016-04-20 Thread John Landmesser
Hi,

 

PopupMenue-component editor is broken.

 

if i try to edit an existing(!!) PopupMenue, i get access violation.

 

It's ok if i create a new PopupMenue

 

Lazarus 1.7 r5 FPC 3.0.0 i386-win32-win32/win64

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


[Lazarus] TDataset result 1e2 instead of 100

2016-04-05 Thread John Landmesser
if i execute fo example a query with a oracle Database: 

 

Select 100 from dual;

 

Result will be 1e2 ( scientific notation )

 

as i learned from this:

 

https://sourceforge.net/p/zeoslib/tickets/22/

 

it's probably caused  by TDataset?

 

Is there any reason for the result > 99 displayed in scientific notation?

 

Ok, i can do a CAST(...) in my SQL-Code, but thats extra work for nothing!

 

Thanks for hints.

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


Re: [Lazarus] System variables visibility

2016-03-31 Thread John Landmesser

On 31.03.2016 17:16, John Landmesser wrote:

Hi,

i developed an application ( Linux ) that need to know where 
$ORACLE_HOME points to.


The only way was to start my app with a shell-script, defining:

#! /bin/bash
export ORACLE_HOME=/usr/lib/oracle/

# run my app
Lazarus_Oracle_app

Had no success defining this variable in bashrc or profile.

But why do i have to define this in my start-script?

Annotation:
perhaps i have to search the sources of ZeosLib, that i'm using 
because of german Umlauts-problems in OracleConnection


Thanks for tipps!!

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



 i think i found the explanation:

oracle tells me:

3. Set the environment variable LD_LIBRARY_PATH to the appropriate 
directory for the Instant Client version, for example:


export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib:$LD_LIBRARY_PATH



so $ORACLE_HOME is not needed but on modern Linux

LD_LIBRARY_PATH is ALLWAYS empty, even if its declared in bashrc or profile

I didn't tell you that i defined LD_LIBRARY_PATH in my script and 
LD_LIBRARY_PATH is blanked as i remember and testet just now.

Debian Sid.

Uh thats all really tricky and i'm no geek :-))




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


[Lazarus] System variables visibility

2016-03-31 Thread John Landmesser

Hi,

i developed an application ( Linux ) that need to know where 
$ORACLE_HOME points to.


The only way was to start my app with a shell-script, defining:

#! /bin/bash
export ORACLE_HOME=/usr/lib/oracle/

# run my app
Lazarus_Oracle_app

Had no success defining this variable in bashrc or profile.

But why do i have to define this in my start-script?

Annotation:
perhaps i have to search the sources of ZeosLib, that i'm using because 
of german Umlauts-problems in OracleConnection


Thanks for tipps!!

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


Re: [Lazarus] Windows API calls and german Umlauts

2016-03-10 Thread John Landmesser

Am 09.03.2016 um 14:16 schrieb Mattias Gaertner:

On Wed, 9 Mar 2016 13:04:50 +0100
"John Landmesser" <jmlandmes...@gmx.de> wrote:


Hi,
  
if i call a windows API function for special folder, like:
  
uses

...
shlobj;
  
var

   AppDataPath: Array[0..MaxPathLen] of Char;
begin
   SHGetSpecialFolderPath(0,AppDataPath,CSIDL_STARTUP,false);
end;
  
I get on a german localized Windows XP a path containing  "Startmenü", but the "ü" is "?" in the resulting string.
  
Howto convert  the chars in AppDataPath to get the "Umlauts" correct?

According to msdn SHGetSpecialFolderPath is not supported by Microsoft.
Instead, use ShGetFolderPath.

Unit LazFileUtils has already a more sophisticated implementation
for UTF8. I added
function SHGetFolderPathUTF8(ID :  Integer) : String;

Mattias

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



that's why opensource is unbeatable:

asked a question at 14:00 h, got a new function in Lazarus at 14:15 h

Thanks Mattias and all people involved!

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


[Lazarus] Windows API calls and german Umlauts

2016-03-09 Thread John Landmesser
Hi,

 


if i call a windows API function for special folder, like:

 


uses 
...
shlobj;
 
var
  AppDataPath: Array[0..MaxPathLen] of Char;
begin


  SHGetSpecialFolderPath(0,AppDataPath,CSIDL_STARTUP,false);

end;

 

I get on a german localized Windows XP a path containing  "\Startmenü\", but the "ü" is "?" in the resulting string.

 

Howto convert  the chars in AppDataPath to get the "Umlauts" correct?

 

Thanks!!


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


Re: [Lazarus] Debian (Sid): fpc 3.0.0+dfsg-2 cannot compile lazarus trunc

2016-02-01 Thread John Landmesser

Am 01.02.2016 um 18:47 schrieb Mattias Gaertner:

On Mon, 1 Feb 2016 18:20:59 +0100
John Landmesser <jmlandmes...@gmx.de> wrote:

Is this the new FPC 3.0.0 from Debian unstable?

Mattias

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


yes it's from unstable ( sid )

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


[Lazarus] Debian (Sid): fpc 3.0.0+dfsg-2 cannot compile lazarus trunc

2016-02-01 Thread John Landmesser

Does anybody else has issues with Debians  fpc 3.0.0+dfsg-2

Downgraded to fpc 2.6.4 to compile Lazarus trunc again!

My system:
Lazarus 1.7 r1.5 FPC 2.6.4 x86_64-linux-gtk 2
( Misleading information here, its Revision 51468 )

fpc 3.0.0+dfsg-2 hangs on ..linking

ok, thats Debian related, but I'm just curious



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


Re: [Lazarus] lhelp broken for Lazarus 1.7 r1.5 FPC 2.6.4 x86_64-linux-gtk 2

2016-01-28 Thread John Landmesser

Am 28.01.2016 um 12:39 schrieb Juha Manninen:

Please test with r51434.

Juha

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



it's ok now again :-))

Thank you very much Juha

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


[Lazarus] lhelp broken for Lazarus 1.7 r1.5 FPC 2.6.4 x86_64-linux-gtk 2

2016-01-27 Thread John Landmesser
got a Mail from Silvio Clecio, but the patch, that should be in Lazarus 
since r51387, r51388 didn't help!


Mail:

Hello @JohnML1  , the |iphttpbroker| unit 
was added recently in the Lazarus components. If you are using a 
stable version of Lazarusm, get and apply all patches sent in this 
issue: http://bugs.freepascal.org/view.php?id=29483.


—
Reply to this email directly or view it on GitHub 
.




tried to compile lhelp with my  r51428 shows me these messages:

Kompiliere Package TurboPowerIPro 1.0: Exit code 1, Fehler: 3, Warnungen: 2
iphtml.pas(12184,6) Warning: User defined: Setting these font colors and 
name messes up the alignment for some reason

iphtml.pas(12202,7) Warning: User defined: TODO Set Font size from CSS Value
iphttpbroker.pas(86,11) Error: identifier idents no member "AllowRedirect"
iphttpbroker.pas(87,11) Error: identifier idents no member "MaxRedirects"
iphttpbroker.pas(130,15) Error: identifier idents no member "IsRedirect"

So no lhelp available!
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Win API function calls with array as parameter

2016-01-21 Thread John Landmesser

works!!

Thank you very much!!

( googled in vain for such a tip )

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


[Lazarus] Win API function calls with array as parameter

2016-01-20 Thread John Landmesser
whàt's wrong?

 

my code started Excel and Word  and i want these Apllication.Windows be arranged on Desktop:

 

but this fails:

 

TileWindows(0, MDITILE_HORIZONTAL,screen.WorkAreaRect,high(MyHandles),@MyHandles);

 

Message:

"unit1.pas(897,84) Error: Call by var for arg no. 5 has to match exactly: Got "Pointer" expected "LongWord"

 

MyHandles is a array of HWND.

 

How to pass this array to the function?

 

 

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


Re: [Lazarus] Lazarus trunc and fpc 2.6.4

2016-01-12 Thread John Landmesser
my own fix: added unit winspool :

 


unit RLPrinters;
{$MODE DELPHI}{$H+}
interface

uses
  {$ifdef LCLWin32}Windows, WinUtilPrn, winspool,{$else}process,{$endif}
  Classes, SysUtils, Math, Forms, Dialogs,
  Graphics, Printers, RLConsts, RLTypes, RLUtils; 



 


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


Re: [Lazarus] Lazarus trunc and fpc 2.6.4

2016-01-12 Thread John Landmesser

Am 12.01.2016 um 11:59 schrieb Juha Manninen:

On Tue, Jan 12, 2016 at 10:32 AM, John Landmesser <jmlandmes...@gmx.de> wrote:

unit RLPrinters;

Where is that unit? I don't find it in Lazarus trunk.

Juha

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


sorry Juha, unit RLPrinters is part of a external package "Fortesreport" .

Still learning the basics :-))

John

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


[Lazarus] Lazarus trunc and fpc 2.6.4

2016-01-11 Thread John Landmesser
i have another issue when i try to compile Lazarus trunc:

 

rlprinters.pas(124,10) Error: Identifier not found "OpenPrinter"
rlprinters.pas(261,73) Hint: Local variable "ResultOrientation" does not seem to be initialized
rlprinters.pas(261,55) Hint: Local variable "ResultPaperHeight" does not seem to be initialized
rlprinters.pas(261,37) Hint: Local variable "ResultPaperWidth" does not seem to be initialized
rlprinters.pas(261,20) Hint: Local variable "ResultPaperSize" does not seem to be initialized
Kompiliere Package pascalscript 0.0.0.1: Abgebrochen

 

 

Win XP  and last working Lazarus is:

 

Lazarus 1.7 r50846 FPC 2.6.4 i386-win32-win32/win64

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


[Lazarus] Lazarus trunc does not compile with fpc 2.6.4 Win32

2016-01-11 Thread John Landmesser
i get this error message if i try to compile 

 

Lazarus 1.7 r50846 FPC 2.6.4 i386-win32-win32/win64

( last working version, December 2015 )

 

Message:

Kompiliere Package SynEdit 1.0: Abgebrochen, Warnungen: 1, Hinweise: 2
synedithighlighterfoldbase.pas(1168,43) Hint: Mixing signed expressions and longwords gives a 64bit result
syntextdrawer.pp(962,31) Warning: Symbol "CanUTF8" is deprecated
syneditfoldedview.pp(352,24) Hint: Value parameter "aFoldProvider" is assigned but never used
Kompiliere Package IDEIntf 1.0: Exit code 1, Fehler: 4, Hinweise: 1
projectintf.pas(708,14) Error: Identifier not found "RawByteString"
projectintf.pas(708,27) Error: Error in type definition
projectintf.pas(729,26) Error: Incompatible type for arg no. 1: Got "", expected "AnsiString"
projectintf.pas(733,35) Error: Incompatible type for arg no. 1: Got "", expected "AnsiString"
graphic.inc(236,20) Hint: Found declaration: TGraphic.LoadFromFile(const AnsiString);

 

My system:

 

Win32 , XP SP 2 

 

Isn't it possible anymore  to compile svn Lazarus with fc 2.6.4 ??

 

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


[Lazarus] new menu designer: dblClick should show assigned code?!!

2016-01-11 Thread John Landmesser

dblClick does not actually show assignde Code?!!

just svn-updated lazarus:

Lazarus 1.7 r1.5 FPC 2.6.4 x86_64-linux-gtk 2

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


Re: [Lazarus] Lazarus trunc does not compile with fpc 2.6.4 Win32

2016-01-11 Thread John Landmessser

Am 11.01.2016 um 15:23 schrieb Mattias Gaertner:

On Mon, 11 Jan 2016 14:24:40 +0100
"John Landmesser" <jmlandmes...@gmx.de> wrote:


[...]
Kompiliere Package IDEIntf 1.0: Exit code 1, Fehler: 4, Hinweise: 1
projectintf.pas(708,14) Error: Identifier not found "RawByteString"

Fixed.

Mattias

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



Mattias fixed and therefore i can compile Lazarus at home ( problem 
occured  in office today )?!!


I'll see tomorrow.

Thanks in advanced :-))

John Landmesser

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


Re: [Lazarus] new menu designer: dblClick should show assigned code?!!

2016-01-11 Thread John Landmesser

Am 11.01.2016 um 18:26 schrieb John Landmesser:

dblClick does not actually show assignde Code?!!

just svn-updated lazarus:

Lazarus 1.7 r1.5 FPC 2.6.4 x86_64-linux-gtk 2

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



just saw it: Revision 51256 ... but ...  r1.5 ( see above )

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


[Lazarus] error on startup of win64-Lazarus compiled with "Optimized IDE"

2015-10-26 Thread John Landmesser

if i start my new compiled Lazarus on windows:

Lazarus 1.5 r50173 FPC 2.6.4 i386-win32-win32/win64
Optimized IDE:
-O2 -g- -Xs

it doesn't start up with  error dialog ..."Risk of data-loss" ok and cancel

All other compile options: "Debug" and "Normal" are ok.

That only happens with "Optimized IDE" and i think for a week now


Same lazarus on linux and "Optimized IDE" is ok!!


Hardware:

Machine:   System: Hewlett-Packard product: HP Compaq dx2400 Microtower PC
   Mobo: PEGATRON model: 2A73h v: 1.01 Bios: American 
Megatrends v: 5.35 date: 12/16/2008

CPU:   Dual core Pentium E5200 (-MCP-) cache: 2048 KB
   clock speeds: max: 2500 MHz 1: 2000 MHz 2: 1600 MHz
Graphics:  Card: Intel 82G33/G31 Express Integrated Graphics Controller
   Display Server: X.Org 1.17.2 drivers: intel (unloaded: 
fbdev,vesa) Resolution: 1920x1080@60.00hz

   GLX Renderer: Mesa DRI Intel G33 GLX Version: 2.1 Mesa 10.6.3
Audio: Card Intel 82801I (ICH9 Family) HD Audio Controller driver: 
snd_hda_intel
   Sound: Advanced Linux Sound Architecture v: 
k4.2.4-towo.2-siduction-amd64
Network:   Card: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
Controller driver: r8169
   IF: eth0 state: up speed: 1000 Mbps duplex: full mac: 
00:22:64:bd:e6:c9
Drives:HDD Total Size: 160.0GB (42.5% used) ID-1: /dev/sda model: 
Hitachi_HDP72501 size: 160.0GB


Am i the only one experience this issue?

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


Re: [Lazarus] use of function ExtractWord

2015-09-15 Thread John Landmesser

got it, thank you very much!!



On 15.09.2015 15:50, Michael Van Canneyt wrote:


Because you cannot specify separate begin and end separator, just 
'separators'.

( is a separator, so everything before ( is the first word.
if you specify ( ) as separators, there are 3 positions in the text:
before (, between ( and ) and after ).
(the last one is empty)

Michael.

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



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


[Lazarus] use of function ExtractWord

2015-09-15 Thread John Landmesser

Hi,

Example:

given a string:

str := '2015-09-14 14:46:50  downloadrate  (813 KB/s)'

if i want to get the first word ( worddelim is space ) i use:

Result := ExtractWord(1 ,str,['  ']);

Result is '2015-09-14'

That's clear :-))

But!

If i want to extract '(813 KB/s)', i have to extract the SECOND word!!

Result := ExtractWord(2 ,str,['( ', ')']);

Result is '813 KB/s'

My question:

Why do i have to extract the SECOND word? The word inside () occurs just 
once!


Delphi 5 delivers the same Result so i'm sure i misunderstand something?!!

lhelp tells me:
ExtractWord extracts the N-th word from the string S. The set of 
characters in WordDelims are used to mark word boundaries. A word is 
defined as any non-empty sequence of characters which are not present 
in WordDelims: if a


character is not in WordDelims, it is considered as part of a word. If 
an N-th word cannot be found, an empty string is returned.




Explanations are welcome.

Thanks!!





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


Re: [Lazarus] FormatFloat('#,##.00', -1) -> .-1,00

2015-09-07 Thread John Landmesser
ok , you are right,  but see the problem: a negative value contains the 
thousandseperator where there is no value >1000


example:

thousandseperator := '|';

FormatFloat('#,##.00', -10);

result:
*|*-10,00

On 07.09.2015 17:14, Werner Pamler wrote:
 the function FormatFloat delivers a bad formatted negative value 
with(!) the dot from ThousandSeparator.


In sysint.inc i found:

   { Character that is put every 3 numbers in a currency }
  ThousandSeparator : Char absolute 
DefaultFormatSettings.ThousandSeparator *deprecated*;


The format '#,##0.00' means: Format the number with two decimal 
places, even if it is an integer. Replace the dot by 
DefaultFormatSettings.DecimalSeparator. If the number is greater than 
1000 (or less than -1000) add a thousand separator, replace the comma 
by the DefaultFormatSettings.ThousandSeparator. The '#' identifies 
optional digits which will be shown only when needed. The '0' 
identifies digits which will be shown even if the corresponding digit 
would be 0 (i.e. if the format string were '0,000.00' then the number 
12 would be displayed as '0.012,00' if DecimalSeparator is '.' and 
ThousandSeparator is '.').




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


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


Re: [Lazarus] FormatFloat('#,##.00', -1) -> .-1,00

2015-09-07 Thread John Landmesser

ok, no i see may mistake:

three symbols!!

'#,##0.00' or '#,###.00'

sorry!!



On 07.09.2015 17:55, Werner Pamler wrote:



thousandseperator := '|';

FormatFloat('#,##.00', -10);

result:
*|*-10,00


The behavior that you observe is a bit strange, maybe it is a bug. But 
you can avoid it by putting three symbols between thousand and decimal 
separator, i.e. use '#,##0.00' or '#,###.00'.



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


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


Re: [Lazarus] FormatFloat('#,##.00', -1) -> .-1,00

2015-09-07 Thread John Landmesser

forgot to mention:

Lazarus 1.5 r49771 FPC 2.6.4 x86_64-linux-gtk 2



On 07.09.2015 16:23, John Landmesser wrote:
the  function FormatFloat delivers a bad formatted negative value 
with(!) the dot from ThousandSeparator.


In sysint.inc i found:

   { Character that is put every 3 numbers in a currency }
  ThousandSeparator : Char absolute 
DefaultFormatSettings.ThousandSeparator *deprecated*;


Does "*deprecated" *mean that this is no error and will not be fixed?



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


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


[Lazarus] FormatFloat('#,##.00', -1) -> .-1,00

2015-09-07 Thread John Landmesser
the  function FormatFloat delivers a bad formatted negative value 
with(!) the dot from ThousandSeparator.


In sysint.inc i found:

   { Character that is put every 3 numbers in a currency }
  ThousandSeparator : Char absolute 
DefaultFormatSettings.ThousandSeparator *deprecated*;


Does "*deprecated" *mean that this is no error and will not be fixed?

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


Re: [Lazarus] whats wrong with that line of code?

2015-08-15 Thread John Landmesser

A) thank you guys!!!

B) Werner Pamler ...

Fazit: ... so its not possible to get the currency symbol  € using 
FormatCurr, that what i learned so far?!!


i was wrong interpreting the function name as delivering a formatted 
number plus(!!) the currency symbol!




On 15.08.2015 12:12, Werner Pamler wrote:

This is how it works with the %m format

procedure TForm1.FormCreate(Sender: TObject);
begin
  DefaultFormatSettings.Currencystring := '€';
  Label1.Caption := Format('%m', [.0]);
  // Format instead of FormatCurr, parameter in square brackets, 
value must be a float

end;

Am 15.08.2015 um 11:13 schrieb John Landmesser:

CurrencyString shows €

FormatCurr('%M',1) - %M

Expected a currency string as '111.111.111,00 €'

System: Linux, Debian Sid

sorry for that really idiotic question :-))



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



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



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


[Lazarus] whats wrong with that line of code?

2015-08-15 Thread John Landmesser

CurrencyString shows €

FormatCurr('%M',1) - %M

Expected a currency string as '111.111.111,00 €'

System: Linux, Debian Sid

sorry for that really idiotic question :-))



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


Re: [Lazarus] whats wrong with that line of code?

2015-08-15 Thread John Landmesser

Hi Michael,

sorry, i still don't get it:

Help to FormatFloat tells me:
FormatFloat formats the floating-point value given by Value using the 
format specifications in Format.


.. and help to Format:
M Currency Format ...

So please correct my,
FormatCurr('%M',1)
so i am able to understand my mistakes ...

thank you!

Ok, i'm stupid!!!




On 15.08.2015 11:40, Michael Van Canneyt wrote:



On Sat, 15 Aug 2015, John Landmesser wrote:


CurrencyString shows €

FormatCurr('%M',1) - %M

Expected a currency string as '111.111.111,00 €'

System: Linux, Debian Sid

sorry for that really idiotic question :-))


Why do you think %M is a formatting character ?

Valid formatting characters are described at:

http://www.freepascal.org/docs-html/rtl/sysutils/formatfloat.html

Michael.


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


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


Re: [Lazarus] Strange: still Mails to my gmail Adress

2015-06-01 Thread John Landmesser



On 29.05.2015 12:15, waldo kitty wrote:


additionally, if you are pulling all these mails to a local mailstore 
with something like thunderbird, are you sure you don't have them 
being stored in a folder under a different server config?


what i mean by that is i keep all my accounts with their own sets of 
folders... at one time i did have rules to move messages into other 
folders under other accounts... that wasn't such a good idea so now i 
keep everything separate... perhaps you have such a rule to copy or 
move mail into another folder?


 ... i had gmail.filters in thunderbird to move mails from my google 
inbox to a folder called gmail.lazarus


I deleted this filter for gmail and created a new one for gmx.de that is 
receiving now the mails  from lazarus.list.


I think the reason for this troubles is thunderbird?!!

Thanks for your advises!





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


Re: [Lazarus] Strange: still Mails to my gmail Adress

2015-05-28 Thread John Landmesser
d25lckluZm8pIHRoZW4KICAgICBSYWlzZUV4Y2VwdGlvbignJyk7Ci0gIGlmIChTcmNGaWxl
PD5uaWwpIGFuZCBGaWxlbmFtZUlzQ29tcGlsZWRTb3VyY2UoU3JjRmlsZS5TaG9ydEZpbGVu
YW1lKSB0aGVuCisgIGlmIChTcmNGaWxlPD5uaWwpIGFuZCBGaWxlbmFtZUlzQ29tcGlsZWRT
b3VyY2UoU3JjRmlsZS5TaG9ydEZpbGVuYW1lKSB0aGVuIGJlZ2luCisgICAgRGVidWdMbign
Q2hlY2sgdGhpcyBmaWxlIC0tPj4gJywgU3JjRmlsZS5GdWxsRmlsZW5hbWUpOwogICAgIFJh
aXNlRXhjZXB0aW9uKCcnKTsKKyAgZW5kOwogICBpZiAoUFBVRmlsZTw+bmlsKSBhbmQgbm90
IEZpbGVuYW1lSXNDb21waWxlZFNvdXJjZShQUFVGaWxlLlNob3J0RmlsZW5hbWUpIHRoZW4K
ICAgICBSYWlzZUV4Y2VwdGlvbignJyk7CiAgIFJlc3VsdDo9bGVuZ3RoKENvbXBpbGVkRmls
ZXMpOwo=
--090305090302070008080409
Content-Type: text/plain; charset=us-ascii
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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

--090305090302070008080409--




On 28.05.2015 19:40, John Landmesser wrote:
long time ago i changed my profile in 
Lazarus@lists.lazarus.freepascal.org from gmail to gmx.de mail-address.


But i still get sometimes mails to my gmail account.

Does Lazarus@lists.lazarus.freepascal.org still have the old Mail-adress?

It's no problem but i would like to know how thats possible!

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



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


[Lazarus] Strange: still Mails to my gmail Adress

2015-05-28 Thread John Landmesser
long time ago i changed my profile in 
Lazarus@lists.lazarus.freepascal.org from gmail to gmx.de mail-address.


But i still get sometimes mails to my gmail account.

Does Lazarus@lists.lazarus.freepascal.org still have the old Mail-adress?

It's no problem but i would like to know how thats possible!

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


[Lazarus] ShellExecute and german umlauts

2015-05-21 Thread John Landmesser
i want to send a mail on windows using shellexecute with german Umlauts ( ,, .. ) in the body of the mail.



This Code doesnt work:



var s: string;

s := 



shellexecute(Application.Mainform.handle, open,PChar(mailto: + exam...@gmail.com + ?subject= + ARJ-ChapterArchiv:  + body= + UTF8ToAnsi(s)),nil, nil, sw_normal);



Good tipps are welcome!



I dont want to use Indy or synapse!

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


Re: [Lazarus] ShellExecute and german umlauts

2015-05-21 Thread John Landmesser



Am 21.05.2015 um 11:37 schrieb Henry Vermaak:

On Thu, May 21, 2015 at 10:06:28AM +0200, John Landmesser wrote:

i want to send a mail on windows using shellexecute with german
Umlauts ( ö,å,ü .. ) in the body of the mail.

This Code doesn't work:

var s: string;

s := 'öö'


shellexecute(Application.Mainform.handle, 'open',PChar('mailto:' +
'exam...@gmail.com' + '?subject=' + 'ARJ-ChapterArchiv: ' +
'amp;body=' + UTF8ToAnsi(s)),nil, nil, sw_normal);

  Good tipps are welcome!I don't want to use Indy or synapse!

I use something like this:

if Win32MajorVersion  5 then
Ret := ShellExecute(0, 'open', PChar(UTF8ToSys(AProg)), nil, nil, 
SW_SHOWNORMAL)
else
Ret := ShellExecuteW(0, 'open', PWideChar(UTF8Decode(AProg)), nil, nil, 
SW_SHOWNORMAL);

Result := Ret  32;

Henry

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



thanks Henry!

found a solution that is ok with umlauts in body:

   var list : TStringList; // body
s : string; // for body without LFN and spaces

   (* LFN replace: *)
  for x := 0 to list.Count -1 do
  s := s + '%0D%0A' + List[x];

  (* replace Spaces : *)
  s := StringReplace(s,' ','%20',[rfReplaceAll, rfIgnoreCase]);


  cmdLine := 'mailto:exam...@gmail.com?subject=ARJ-ChapterArchiv: 
'  + ArchName + 'body=' + s;

  if not Openurl(cmdLine) then

that works, but i don't know why, Perhaps your

PChar(UTF8ToSys(AProg))

and

PWideChar(UTF8Decode(AProg))


is the trick?



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


[Lazarus] Lazarus svn broken?

2015-05-13 Thread John Landmesser

Lazarus 1.5 r47981 FPC 2.6.4 x86_64-linux-gtk 2

if i choose a *.lpi out of the projects history list, lazarus crashes!

Its ok, if i open *.lpi as open with lazarus!

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


[Lazarus] Howto scrolldown a TMemo on Linux by code?

2015-05-12 Thread John Landmesser
for windows this code works ok, but no success for Linux, GTK:



  (* Memo2 ans Ende scrollen *)
  {IFDEF LINUX}

  // that doesnt work:
   Memo2.SelStart:=Length(Memo2.lines.Text);
   Memo2.VertScrollBar.Position:=1;
  {ELSE }

   // thats ok on windows
   SendMessage(Memo2.Handle, WM_VSCROLL, SB_BOTTOM, 0);
  {ENDIF}




Lazarus 1.5 r48256 FPC 2.6.4 x86_64-linux-gtk 2


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


[Lazarus] Howto scrolldown a TMemo on Linux by code?

2015-05-12 Thread John Landmesser

for windows this code works ok, but no success for Linux, GTK:
(* Memo2 ans Ende scrollen *)
{$IFDEF LINUX}
 // that doesn't work:
  Memo2.SelStart:=Length(Memo2.lines.Text);
  Memo2.VertScrollBar.Position:=1;
{$ELSE }
  // thats ok on windows
  SendMessage(Memo2.Handle, WM_VSCROLL, SB_BOTTOM, 0);
{$ENDIF}
Lazarus 1.5 r48256 FPC 2.6.4 x86_64-linux-gtk 2

another question:
How does this mailing list know to which question i post an answer?

My first post was placed as an answer to IDE / Editor macros from 
Graeme Geldenhuys?
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Error in project path settings editor : TControl.InvalidatePreferredSize loop detected PathEditorDialog:TPathEditorDialog Bounds

2015-04-13 Thread John Landmesser
newest svn Lazarus Win32, all clean build.



Lazarus 1.5 r48740 FPC 2.6.4 i386-win32-win32/win64



Full error message:

TControl.InvalidatePreferredSize loop detected PathEditorDialog:TPathEditorDialog Bounds=l=420,t=156,r=16981,b=572.





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


Re: [Lazarus] howto change the order the components of a Form are created?

2015-04-09 Thread John Landmesser



On 09.04.2015 20:27, Howard Page-Clark wrote:
Project Options lets you order the creation of auto-created forms, but 
it does not handle other objects.


Can you not dynamically create these two objects in order like this?

procedure TForm1.FormCreate(Sender: TObject);
begin
  FIniPropStorage:=TIniPropStorage.Create(Self);
  //  with FIniPropStorage do ... etc.

  FFilelistbox:=TFileListBox.Create(Self);
  // with FFilelistbox do ...
end;

Howard


---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com


--


thanks Howard but i was struggling with the wrong problem:

i have a TShellTreeView and i want to set the TShellTreeView.Path 
property by code ( saved in a ini-File ) , but that doesn't work because 
you can't  assign a string to this property?


   ShellTreeView1.Path := '/media/First_XPS/PROJEKTE/Lazarus/arjgui/';
   ShowMessage(ShellTreeView1.Path);

Path is '' ?!!!

I try again tomorrow :-))

Perhaps windows only, i'm Linux?!!




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


[Lazarus] howto change the order the components of a Form are created?

2015-04-09 Thread John Landmesser
from Delphi i know there is a editor to change the order in which 
objects of the Application are created:


I have a IniPropStorage and that has to be created before a FileListView.

Searched the IDE, i know its there, but i can't find it!

Thank you!

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


[Lazarus] Does sdfdataset support locate and lookup?

2015-04-02 Thread John Landmesser

Tipps are welcome:

This code snippet doesn't work:


var val : Variant;
begin
  val := Editinput.Text;
  val := SdfDataSetNew1.Lookup('Spalte1',VarArrayOf([val]),'Spalte3');

  if not VarIsNull(val) then
   Editoutput.Text:=val[0]
  else
   Editoutput.Text:= 'VarIsNull'; 



perhaps i ask here and go then to the source?

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


Re: [Lazarus] svn version of Lazarus broken?

2015-03-31 Thread John Landmesser

found the solution: TSynEdit!!

http://forum.lazarus.freepascal.org/index.php?topic=15106.0


it's nearly the same as TSynMemo

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


[Lazarus] svn version of Lazarus broken?

2015-03-30 Thread John Landmesser

Hi,

if i compile todays ( 30.03.15 ) svn Version of Lazarus,  TSynMemo for 
example can't be dropped on a form:


Message:
Fehler beim Erzeugen der Komponente: TSynMemo Invalid type cast

Lazarus 1.5 r48534 FPC 2.6.4 i386-win32-win32/win64

Before that Lazarus wants to add some synedit units to the uses clause 
of my project that uses TSynMemo , but that perhaps went wrong too?


perhaps somebody else has this issue too?

For lazarus on linux everything is ok!!

Lazarus 1.5 r47221 FPC 2.6.4 x86_64-linux-gtk 2



 John Landmesser

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


[Lazarus] popup menu-editor

2015-03-04 Thread John Landmesser

Hi,

just an Align := alClient for the Menu-entries would help me to see 
which menu-entries are there :-))





Lazarus 1.5 r47221 FPC 2.6.4 x86_64-linux-gtk 2
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Play video files in a row without delay

2015-02-21 Thread John Briggs
On Fri, Feb 20, 2015 at 12:04:06AM -0800, aradeonas wrote:
 Thank you Mike and John.
 
 But I test playlists with VLC,mplayer and ffplay and problem is after
 first file finish thery is a 0.5 second delay for opening second file
 and its not good for project because files are tiny videos(less than 5mb
 and 4 seconds) and this delay is not good at all.I need to read second
 file before first one or pass every frame at a time to player.
 

Well perhaps the only other way to do this easily is:
cat file1 file2   newfile

Play newfile

John

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


Re: [Lazarus] Play video files in a row without delay

2015-02-19 Thread John Briggs
As mentioned by Mike earlier generate a plaaylist of the videos you want to
watch and vlc/mplayer will play them for you with little or no delay
between videos.

John

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


[Lazarus] vin...@gmail.com

2015-02-16 Thread john
Vince,

I am not quite sure how to respond to a posting, if I havn't done it correctly, 
sorry, ignorance sounds so much better than 'stupidity'.

Vince, this is just a personal opinion but you may find this forum a little 
'choppy' to pick up general and structural knowledge from. I would recommend 
the Lazarus Manual for a reasonable structure and it seems to be quite 
complete. I have been heavily into Kylix for the past number of years and the 
IDE for Lazarus seems to be more reliable and the compatibility to Kylix is 
also excellent, from my experience. Using that logic, any book on Kylix would 
probably put the 'structure' would also help in using Lazarus. My only 
additional comment would pick the database you plan on using and stick to it, 
mysql seems to be the most used, but I don't want to start a fight with any of 
the others, I took my poll made my decision and like the decision so far, but 
that is just me. Try to jump into development with a short, real problem that 
will teach you the most for the least code, have a few glasses of wine, with 
dinner. Then the next day, decide what you learned.
I haven't doubted for a day I made the correct choice, first with Delphi, then 
Kylix and now Lazarus, good luck.
John A. Ward, j...@mbstemps.com




-Original Message-
From: lazarus-requ...@lists.lazarus.freepascal.org 
[mailto:lazarus-requ...@lists.lazarus.freepascal.org]
Sent: Monday, February 16, 2015 11:52 AM
To: lazarus@lists.lazarus.freepascal.org
Subject: Lazarus Digest, Vol 85, Issue 51

Send Lazarus mailing list submissions to
lazarus@lists.lazarus.freepascal.orgTo subscribe or unsubscribe via the World 
Wide Web, visit   
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarusor, via email, send 
a message with subject or body 'help' to
lazarus-request@lists.lazarus.freepascal.orgYou can reach the person managing 
the list at   lazarus-owner@lists.lazarus.freepascal.orgWhen replying, 
please edit your Subject line so it is more specificthan Re: Contents of 
Lazarus digest...Today's Topics: 1. Freepascal/Lazarus port of JEDI Code 
Library (JCL) (luiz americo pereira camara) 2. Re: Embedded/small database 
(Kostas Michalopoulos) 3. Hi everyone (Vincenzo Campanella) 4. Re: 
Embedded/small database (Graeme Geldenhuys) 5. GIS (Terry A. Haimann) 6. Re: Hi 
everyone (Travis Ayres) 7. Re: How to access libraries from other languages? 
(Chavoux 
Luyt)--Message:
 1Date: Mon, 16 Feb 2015 12:23:27 -0300From: luiz americo pereira camara 
Subject: [Lazarus] Freepascal/Lazarus port of JEDI Code Library (JCL)To: 
Lazarus mailing list Message-ID:  Content-Type: text/plain; charset=utf-8Hi,I 
ported JCL to Freepascal/Lazarus. More info 
athttps://github.com/blikblum/jclAlthough most of the changes was adjusting 
defines / uses clause to makecompilable, it needs more tests since I only 
tested JclExprval.Luiz-- next part --An HTML attachment 
was scrubbed...URL: --Message: 2Date: Mon, 16 Feb 
2015 16:50:04 +0100From: Kostas Michalopoulos Subject: Re: [Lazarus] 
Embedded/small databaseTo: Lazarus mailing list Message-ID:  Content-Type: 
text/plain; charset=utf-8Is this something that will be networked or running 
locally? If it is alocal only program, i'd go with sqlite.On Sun, Feb 15, 2015 
at 7:16 PM, Graeme Geldenhuys mailingli...@geldenhuys.co.uk wrote: On 
2015-02-15 16:58, zeljko wrote:  Maybe you should look at Firebird. +1 
Regards, - Graeme - -- ___ 
Lazarus mailing list Lazarus@lists.lazarus.freepascal.org 
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus-- 
next part --An HTML attachment was scrubbed...URL: 
--Message: 3Date: Mon, 16 Feb 2015 16:54:55 
+0100From: Vincenzo Campanella Subject: [Lazarus] Hi everyoneTo: Lazarus 
mailing list Message-ID: 54e212cf.4020...@gmail.comContent-Type: text/plain; 
charset=iso-8859-15; format=flowedHi everyoneI have just subscribed to this 
mailing list, being interested in a future (in the next few months) development 
of an accounting program using Pascal + Lazarus.For the time being, I'll 
probably lurk keeping silent, but then I'll start asking questions, hoping not 
to disturb you, as my Pascal and Lazarus skills are for sure not the best (up 
to now experiences in C and Access VBA only).Meanwhile, thank you for Lazarus 
that seems a very very interesting development tool.Sorry for my bad English, 
but my mother tongue is Italian and I am from 
Switzerland.Cheers,vince--Message: 4Date: Mon, 16 
Feb 2015 16:11:56 +From: Graeme Geldenhuys Subject: Re: [Lazarus] 
Embedded/small databaseTo: lazarus@lists.lazarus.freepascal.orgMessage-ID: 
54e216cc.6090...@geldenhuys.co.ukContent-Type: text/plain; charset=utf-8On 
2015-02-16 15:50, Kostas Michalopoulos wrote

Re: [Lazarus] German Umlauts and Oracle Connection

2015-02-10 Thread John Landmesser
Am 09.02.2015 um 20:37 schrieb Michael Van Canneyt:
 
 
  Normally, I'd expect you'd have to specify UTF8 as the charset, since 
  that is what the LCL uses.

Tried a lot to get OracleConnection working with german special
characters like ö ä ü ß  but without success.

Then i tried ZeosLib that works out of the box!

I want to figure out how they solve this CodePage thing, but i think
thats fare beyond my knowledge :-((




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


Re: [Lazarus] German Umlauts and Oracle Connection

2015-02-10 Thread John Landmesser

Am 10.02.2015 um 16:17 schrieb Mattias Gaertner:

SQLDB has CharSet, but unit oracleconnection does not seem to use it.

Mattias

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


I tried a lot to get OracleConnection working but in vain.

No i use ZeosLib thats working out of the Box.

I want to try to understand how they managed these CodePage thing, but i 
think thats far beyond my knowledge!


Wondering: if i send a message from my gmail accounjt, it never shown up 
in this list!??



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


[Lazarus] German Umlauts and Oracle Connection

2015-02-09 Thread John Landmesser
i get Citynames from a oracle Database, but i get for example Gie?en 
instead of Gießen In a TDBGrid.


I tried different Charset in my OracleConnection.Charset as mentioned 
from Oracle on


http://docs.oracle.com/cd/B28359_01/server.111/b28298/applocaledata.htm#CIAJAGCB

but without success!


If i put a Tedit on my form, i can write Gießen, so it has to be a 
setting in OracleConnection?!!


MainForm.Font.CharSet Is DEFAULT_CHARSET

Tipps are welcome!

( strange: sent this mail from my gmail account today 16:26, but it 
never arrived?? )


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


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

2015-02-06 Thread John Landmesser

Am 05.02.2015 um 16:53 schrieb Donald Ziesig:

Hi All!

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


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


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


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


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


Thanks,

Don Ziesig
'

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



i do it your way too, no problems!

in fstab ( Debian, sid ) i have these settings

ntfs-3gdefaults,auto,users,locale=de_DE.utf8,exec

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


[Lazarus] Howto close my Bugreport in Mantis??

2015-01-25 Thread John Landmesser

sorry, i couldn't find a way to close my own Bugreport 0027202

It's no bug!!
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] CHM help age and readmechm.txt in a fresh installation

2015-01-20 Thread John Landmesser

perhaps that is the solution?

http://sourceforge.net/projects/lazarus/files/Lazarus%20Documentation/Lazarus%201.2/

Am 20.01.2015 um 11:37 schrieb Andi:
I do a complete fresh installation  of Lazarus 
(lazarus-1.2.6-fpc-2.6.4-win32.exe) from 20.1.2015, on a complete 
fresh PC.
I found the chm documentation in the Lazarusinstalldir/docs/chm, but 
the files in this directory are from 24.8.2012 13:21 !!


Is this the last documentation and correct for this build ?

In the readmechm.txt file i found following
- citation start 
This CHM snapshot was build on 2012-08-01 by using fpdoc from trunk to
compile the docs for fixes2_6 and the lazarusrc1 tag.

How to install the CHMs in Lazarus


- Install the chmhelp package
- Copy the chms to docs/html in the Lazarus directory.

Note that Lazarus does not load ref.* at this moment, so (CHM) help
on keywords does not work yet.

- citation end 

The chm are in the rigth place, i think, why should i transfer the 
files to the docs/html directory ? Maybe the information in the file 
is also outdated.


Andreas

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



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


[Lazarus] Error after Application.Terminate

2015-01-20 Thread John Landmesser

which compiler-option(?) produces such a error Dialog?

---
Error
---
Heap dump by heaptrc unit

51266 memory blocks allocated : 8658068/8812400

51266 memory blocks freed : 8658068/8812400

0 unfreed memory blocks : 0

True heap size : 294912 (112 used in System startup)

True free heap : 294800


---
OK
---

 




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


Re: [Lazarus] Is FPDoc Editor working?

2014-12-20 Thread John Landmesser

sorry, this is  off topic:

do you see this in your mailing list:

Topic. SQL Editor produces wrong string constant from John Landmesser 
( /Fri Dec 19 16:28:09 CET 2014 )/


I can't find it in my Mail-Client.

I can see it in pipermail -archive December.

http://lists.lazarus.freepascal.org/pipermail/lazarus/2014-December/089883.html

That's not the first time i cannot see my own writings.

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


Re: [Lazarus] Is FPDoc Editor working?

2014-12-20 Thread John Landmesser

On 20.12.2014 10:40, Vincent Snijders wrote:



2014-12-20 10:18 GMT+01:00 John Landmesser jmlandmes...@gmail.com 
mailto:jmlandmes...@gmail.com:


sorry, this is  off topic:

do you see this in your mailing list:

Topic. SQL Editor produces wrong string constant from John
Landmesser ( /Fri Dec 19 16:28:09 CET 2014 )/


Yes, I can see it.


I can't find it in my Mail-Client.


What email client to you use?


I can see it in pipermail -archive December.


http://lists.lazarus.freepascal.org/pipermail/lazarus/2014-December/089883.html

That's not the first time i cannot see my own writings.


Any Tipps?


Use a different (not gmail) address to receive your email.

If you send an email with gmail, it is in your sent messages. If gmail 
receives that message, it won't put it in your inbox, but you already 
have it in your sent messages. So you get less clutter in your inbox.


Vincent


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



thank you Vincent!

I'll change to gmx.de
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] SQL Editor produces wrong string constant

2014-12-19 Thread John Landmesser

Hi,

Lazarus 1.3 r47221 FPC 2.6.4 x86_64-linux-gtk 2

example SQL-Editor:

SELECT Datum, Zeit FROM Daten
WHERE Datum  '01.01.2014'

After create String constant:
SQL = 'SELECT Datum, Zeit FROM Daten'+LineEnding+
'WHERE Datum  ''01.01.2014''';

This statement will not be executed!
Before and after +LineEnding+ is missing  a blank:
 '   ' +LineEnding+ '   '

simple to fix!!

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


[Lazarus] How to use ZMSQL?

2014-12-16 Thread John Landmesser
Hi,

trying to use ZMSQL to read a flat file:

there is an articel in the wiki, a sample app from sourceforge and my own
unsuccesfull tries to get one single file opened!
Even the example projects don't work!

Does anybody can point me in the right direction how to use
ZMConnection and ZMQueryDataSet to open a file with Fieldnames in the first
line, Seperator is Semikolon and Windows LineEnd ?

Thanks!

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


Re: [Lazarus] TTIGrid crashed after calling ListObject.Add

2014-12-09 Thread John Landmesser
no crash on a 32bit Windows XP with

Lazarus 1.3 r47147 FPC 2.6.4 i386-win32-win32/win64

2014-12-09 4:39 GMT+01:00 Kiên Nguyễn Tiến Trung kc97...@gmail.com:

 I'm finding the way to add something into a TCollection while using
 TTIGrid on it. I've tried following code, however, when I click Button1,
 then click to the space inside the grid, my program crashed. Please have a
 look at my attachment for more detail.

 procedure TForm1.Button1Click(Sender: TObject);
 begin
   TIGrid1.ListObject := nil;
   MyCollection.Add;
   TIGrid1.ListObject := MyCollection;
 end;

 Do you know the right way to call add an item into TCollection?

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


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


[Lazarus] Error message if lazarus is closed

2014-09-29 Thread John Landmesser
Hi list,

since some time i get an error message if i close lazarus:

content of the message dialog:

In 'file:///home/john1/.lazarus' (line 1 pos 1): Root element is missing
In 'file:///home/john1/.lazarus' (line 1 pos 1): Root element is missing

But there is no .lazarus file, but the folder .lazarus?!!

The caption of the MessageBox is in german Lesefehler (reading error).

So i think lazarus tries to read a file, that doesn't exist?!

my lazarus:
Lazarus 1.3 r46345 FPC 2.6.2 x86_64-linux-gtk 2


Should i write a bug report?
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Error message if lazarus is closed

2014-09-29 Thread John Landmesser
notice:

just startet lazarus from Terminal and saw this line:

[TJITComponentList.DestroyJITComponent] ERROR destroying component
Error: In 'file:///home/john1/.lazarus' (line 1 pos 1): Root element is
missing


that should give a important hint ( ... but not for me )

***

Am Montag, den 29.09.2014, 15:35 +0200 schrieb John Landmesser:
 Hi list,
 
 
 since some time i get an error message if i close lazarus:
 
 
 content of the message dialog:
 
 
 In 'file:///home/john1/.lazarus' (line 1 pos 1): Root element is
 missing
 In 'file:///home/john1/.lazarus' (line 1 pos 1): Root element is
 missing
 
 
 
 But there is no .lazarus file, but the folder .lazarus?!!
 
 
 The caption of the MessageBox is in german Lesefehler (reading
 error).
 
 
 So i think lazarus tries to read a file, that doesn't exist?!
 
 
 my lazarus:
 Lazarus 1.3 r46345 FPC 2.6.2 x86_64-linux-gtk 2
 
 
 
 
 
 Should i write a bug report?
 
 
 
 
 
 
 
 



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


Re: [Lazarus] Error message if lazarus is closed

2014-09-29 Thread John Landmesser

Hi Mattias:

notice:

just startet lazarus from Terminal and saw this line:

[TJITComponentList.DestroyJITComponent] ERROR destroying component
Error: In 'file:///home/john1/.lazarus' (line 1 pos 1): Root element is
missing


that should give a important hint ( ... but not for me )

***






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


Re: [Lazarus] Unable to debug GUI

2014-07-16 Thread John Landmesser
..reminds me at a bug in intel Drivers i had trouble with on Linux-Mint
cinnamon:

try this (quote from a forum
http://forums.linuxmint.com/viewtopic.php?f=221t=146477 ):

*



I have a Intel GPU, and i have these annoying black windows.

But you can do it this way:

create as root the file /etc/X11/xorg.conf

in terminal type ( if you don't have a /etc/X11/xorg.conf ) :
sudo touch /etc/X11/xorg.conf

open editor in admin mode:
gksu gedit /etc/X11/xorg.conf

... and write/copy these lines:

Section Device
Identifier Card0″
Driver intel
Option AccelMethod sna
EndSection

reboot

if that doesn't help do in terminal:
rm /etc/X11/xorg.conf
to delete it again


seems to work ok for me, but i have to test this some days first.

update: 10.07.14
..still working ok!
That was the solution for these annoying black pop-up windows!!

***



Am Montag, den 14.07.2014, 11:08 +0200 schrieb Michael Van Canneyt:
 Hi,
 
 I have a machine on which I'm completely unable to debug GUI programs.
 The machine runs Ubunutu 12.04 LTS.
 If I try to debug, the whole system (at least X11, later the complete system) 
 hangs as soon as there is a breakpoint in a GUI event handler.
 
 It doesn't matter whether I do the debugging in Lazarus or in GDB directly.
 
 The same program, the same breakpoint on another machine, same OS, works just 
 fine.
 
 The sole difference between the 2 machines is the graphics display: 
 An NVidea card on the machine that is OK,
 An on-board Intel chip on the machine that does not work.
 
 So I'm inclined to suspect a buggy intel graphics driver.
 
 Has anyone experienced such a situation? If so, I'd appreciate any hints you 
 may have.
 
 Michael.
 
 --
 ___
 Lazarus mailing list
 Lazarus@lists.lazarus.freepascal.org
 http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus



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


Re: [Lazarus] Compiling svn Lazarus on Linux/windows

2014-07-05 Thread John Landmesser
thank you!!

Am Samstag, den 05.07.2014, 00:06 -0700 schrieb leledumbo:
 The basic rule is that svn version should always be compilable with latest
 release version, not necessarily previous ones.
 
 
 
 --
 View this message in context: 
 http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-Compiling-svn-Lazarus-on-Linux-windows-tp4037802p4037828.html
 Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com.
 
 --
 ___
 Lazarus mailing list
 Lazarus@lists.lazarus.freepascal.org
 http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus




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


Re: [Lazarus] Compiling svn Lazarus on Linux/windows

2014-07-05 Thread John Landmesser
Am Samstag, den 05.07.2014, 13:59 +0300 schrieb Juha Manninen:
 On Thu, Jul 3, 2014 at 2:10 PM, John Landmesser jmlandmes...@gmail.com 
 wrote:
  i can compile any svn version of lazarus on linux using fpc 2.6.2 but on
  windows i have(!!) to use fpc 2.6.4.
 
 If you really need to use fpc 2.6.2, we can make it compile. What is
 the error? Is it easy to fix using eg. IFDEFs? If you send a patch to
 fix compilation, it will be applied.
 On the other hand, updating to the latest FPC is generally a good idea.
 
 Juha
 
 --
 ___
 Lazarus mailing list
 Lazarus@lists.lazarus.freepascal.org
 http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus



i don't know the error any more ... updated to fpc 2.6.4 that compiled
svn lazarus.

Just wondered about the differences between Win and Linux!



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


[Lazarus] Compiling svn Lazarus on Linux/windows

2014-07-03 Thread John Landmesser
i can compile any svn version of lazarus on linux using fpc 2.6.2 but on
windows i have(!!) to use fpc 2.6.4.

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


Re: [Lazarus] Option hints popup truncated

2014-06-03 Thread John Landmesser
.. same issue ( sometimes ) with toolbar button hints.

GTK2 and Linux


2014-06-02 22:00 GMT+02:00 Mattias Gaertner nc-gaert...@netcologne.de:

 On Mon, 2 Jun 2014 21:44:53 +0200
 Bart bartjun...@gmail.com wrote:

  On 6/2/14, Michael Van Canneyt mich...@freepascal.org wrote:
 
   The popup with the hints for the arguments to a function is sometimes
   truncated:
   it is too short to display the contents, and the contents is cut off
 halfway
   the popup.
 
  I see this frequently, but then again not always on my Linux VM.
  My IDE is build for GTK2

 I agree with Zeljko it looks like a clipping bug.
 This hint is painted in ide/codecontextform using
 the form's Canvas.ClipRect. I replaced the Canvas.ClipRect with
 ClientRect.

 Please test.

 Mattias



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

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


[Lazarus] ZeosLib and Lazarus svn

2014-05-03 Thread John Landmesser

Hi List,

i have Lazarus svn on Debian:

Lazarus 1.3 r44902 FPC 2.6.4 x86_64-linux-gtk 2

i cannot compile and install Zeoslib 7 (stable) got it with svn

Error:
ZEOSDBO/src/component/ZAbstractDataset.pas(524,13) Error: Incompatible 
types: got AnsiString expected Pointer


I think i have to change something in
ZeosLazarus.inc

but what??

Tipps are welcome ...


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


[Lazarus] Debian: fpc-source update

2014-05-01 Thread John Landmesser

Ok, a little bit off topic, but perhaps someone has the answer.

On my Debian ( sid ) i installed fpc-source with apt-get.

After dist-upgrade i have two versions of fpc-source:


apt-cache policy  fpc-source
fpc-source:
  Installiert:   2.6.4+dfsg-1
  Installationskandidat: 2.6.4+dfsg-1
  Versionstabelle:
 *** 2.6.4+dfsg-1 0
500 http://ftp.de.debian.org/debian/ unstable/main i386 Packages
100 /var/lib/dpkg/status
 2.6.2-8 0
500 http://ftp.de.debian.org/debian/ unstable/main i386 Packages




do i have to remove version 2.6.2 manually?

If i do
apt-cache show   fpc-source

there is no line replaces .., so i think its my job to remove the old 
fpc-source 2.6.2??


But why??

Thanks for a tipp!!

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


[Lazarus] Howto dropdown the calendar of TDateEdit programmatically

2014-03-07 Thread John Landmesser

Hi,

i want to dropdown the calendar of an DateEdit at start of my app, so 
the user will see what to do next.


There is a DateEdit.Button.Clicḱ procedure and 
TCustomMaskEdit.DoButtonClick, but they don't show the calendar.


Is it possible to show the calendar by code?

thank you for a tipp!!

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


[Lazarus] Windows DOS-Box behind a running app, why??

2014-03-04 Thread John Landmesser
Hi,

i developed a project-template and it works ok!

But some project-options(?) leed to a Dos-Box behind my running application.

I could not find the checkbox(?) in project-options(?) that results to such
a behaviour!

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


Re: [Lazarus] Getting and setting the x numbered word in a sentence

2014-01-08 Thread John Landmesser

On 07.01.2014 19:04, Richard Mace wrote:


Hi,
Is there an existing routine in Lazarus that will get and set 
effectively the x numbered word in a sentence without actually knowing 
what the actual word is?

E.g with the string the cat sat on the mat
You could say replace word 3 with string stood so the result would 
be a string which was  the cat stood on the mat even though you 
didn't know that the 3rd word was originally sat?

Hope that makes sense :)
Thanks
Richard



Have a look at functions in StrUtils like:

function WordCount(const S: string; const WordDelims: TSysCharSet): Integer;
function WordPosition(const N: Integer; const S: string; const 
WordDelims: TSysCharSet): Integer;
function ExtractWord(N: Integer; const S: string;  const WordDelims: 
TSysCharSet): string;inline;
function ExtractWordPos(N: Integer; const S: string; const WordDelims: 
TSysCharSet; var Pos: Integer): string;


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


Re: [Lazarus] Application Information

2013-12-23 Thread John Meyer

I think we're talking about the compiled application's version number.



On 12/23/2013 10:18 AM, Bart wrote:

On 12/23/13, Hew Lines hewli...@shaw.ca wrote:


Can anyone give me any ideas on how to access the data in the Project
Application dialogue ? Specifically the Version Number. I would like to
include the Version Number in both my About box as well as the Title Bar
of the main form but I have been unable to figure out how to access the
data stored in the Project Information dialogue.

From some project of mine.

   LazVersion := 'Lazarus '+ LCLVersion;
   FpcVersion := 'FPC ' + {$I %FPCVERSION%};

The Lazarus revision resides in ide/revision.inc, but I'm not sur
eit's wise to include it in your project?

Bart

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



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


Re: [Lazarus] DateDif function needed

2013-11-18 Thread John Landmesser

On 18.11.2013 13:11, Frederic Da Vitoria wrote:
procedure DatesToAge (Date1, Date2: TDate ; out Years, Months, Days: 
integer);

var


Hi Frederic,

your code works as aspected!

Perhaps it's more usual if you change the out Parameters to word?!

Regards

John


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


Re: [Lazarus] DateDif function needed

2013-11-16 Thread John Landmesser

On 08.11.2013 21:35, John Landmesser wrote:

Hi List,

i'm searching a pascal datetime function that simulates an Excel 
function: DateDif


Excel for example knows the function DateDif that returns the number 
of Years, month and days between Date1 and date2.


Date1 := 21.12.2012
Date2 := 01.01.2013

Result would be: 0 years, 0 moths, 11 days

I tried to do it on my own, but without success.

But i think there is a function out there but i don't know its name :-((

Thanks for your tipps

John

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


Hi list,

This discussion seems to be finished ( 92 posts ) and i want to make a 
proposal as solution:


Use the function DateDiff from Jedi ( RxLib ) ( JvJCLUtils.pas ).

It's not perfect, but it works for me:

**

procedure DateDiff(Date1, Date2: TDateTime; var Days, Months, Years: word);
var
  DtSwap: TDateTime;
  Day1, Day2, Month1, Month2, Year1, Year2: word;
begin
  if Date1  Date2 then
  begin
DtSwap := Date1;
Date1 := Date2;
Date2 := DtSwap;
  end;
  DecodeDate(Date1, Year1, Month1, Day1);
  DecodeDate(Date2, Year2, Month2, Day2);
  Years := Year2 - Year1;
  Months := 0;
  Days := 0;
  if Month2  Month1 then
  begin
Inc(Months, 12);
Dec(Years);
  end;
  Inc(Months, Month2 - Month1);
  if Day2  Day1 then
  begin
// von mir auskommentiert Inc(Days, DaysPerMonth(Year1, Month1));
Inc(Days, DaysInAMonth(Year1, Month1));
if Months = 0 then
begin
  Dec(Years);
  Months := 11;
end
else
  Dec(Months);
  end;
  Inc(Days, Day2 - Day1);
end;

**

Hope that statement is usefull for somebody reading this thread.

I couldn't find any bug report on Project JEDI - Issue Tracker.

Thanks for this discussion!

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


Re: [Lazarus] DateDif function needed

2013-11-14 Thread John Landmesser

On 14.11.2013 10:50, Reimar Grabowski wrote:

For MySQL:

DATEDIFF(expr1,expr2)

DATEDIFF() returns expr1 – expr2 expressed as a value in days from one
date to the other. expr1 and expr2 are date or date-and-time
expressions. Only the date parts of the values are used in the
calculation.

:)

R.


... be carefull!

Databases as MySQL or FirebIrd or Oracle have a buildin function 
DateDiff, but the result is different!!


Our function delivers the age of a person in years, months, days.

The other datediff function delivers years OR month OR days.

So you can't use them to calculate the age of a person for example!!

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


Re: [Lazarus] DateDif function needed

2013-11-14 Thread John Landmesser

On 14.11.2013 14:16, Mattias Gaertner wrote:

On Thu, 14 Nov 2013 13:48:46 +0100
John Landmesser joh...@online.de wrote:


[...]
Our function delivers the age of a person in years, months, days.

What is your diff between 31th Jan and 30 March 2013?

Mattias

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

answer:
Jedi DateDiff: 0 Year, 1 month,  30 days


It's really difficult according to waldo kitty's post: today 14:10

*

Hihi, i asked a question about a DateDiff function for FreePascal, 
because i wanted to know: how many years, month, days left to work in 
Office until my pension begins on 01.08.2018.


.. and where are we now??

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


Re: [Lazarus] DateDif function needed

2013-11-13 Thread John Landmesser

On 13.11.2013 02:33, waldo kitty wrote:


actually, i have in some cases... let's ask this question and see what 
your charts and routines return as the result... assuming your format 
is DD.MM....


Date1 := 01.01.2000
Date2 := 01.01.2000

should be 0 (zero), right?

then

Date1 := 01.01.2000
Date2 := 02.01.2000

should be 1 (one), right?

in this case, what i (and bart, too) wrote, we're not counting the 
starting day but we are counting the ending day... this rule stays in 
effect throughout the entire process... my head still aches from 
rummaging about doing this... it was good exercise and one i remember 
being given on a test many years back to determine one's coding 
level... at that time, the code was being done in dBase II/III/IV ;)


i will have to dig deeper and see what is crossing things up for count 
from 29.02.2000 to 28.02.2001... i see bart has posted a fix which i 
have not yet had a chance to compare with my code or run thru the 
tests i included in my posting...


the real question is this:

  what do we count? the starting day, the ending day, both days or 
neither day?


then we have another question:

  is dayM in monthY a one month difference to dayM in monthX and
  monthZ? monthX, monthY, monthZ are any three consecutive months
  in linear order within one year or crossing two years

once the rules are chosen, then we have something to work with...



I'm just a hobbyist, never went to university to study computer science.

We don't need to invent the wheel again, because others have solutions 
for that!


Perhaps its solved in  The Art of/Computer Programming/ from Donald E. 
Knuth?


I don't have such books and i don't know if i'd have the chance to 
understand such a book?!!


Yesterday i was running windows on this PC and tried MS Visual Studio 
2008 Help.
That showed me ( - DateDiff ) a Tutorial from a MS-India guy that 
delivered code to calculate DateDiff.


I'm now running Linux but perhaps i reboot later to look again?

Bart delivered code that calculates 29.02.2000 to 28.02.2001 = 1 Year.
And that looks reasonable to me!

Bart wrote:

I would actually say that in this particular case the diff is 1 Year...
(11 M + (28 days in feb in a non-leapyear = 1M) = 12M = 1 Y.

Bart


Soon we'll have working DateDiff function and my question will be 
answered in the end!

Thanks guys!!


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


Re: [Lazarus] DateDif function needed

2013-11-13 Thread John Landmesser

On 13.11.2013 14:02, waldo kitty wrote:


We don't need to invent the wheel again, because others have 
solutions for that!


then why does this thread exist? O:)


I'll try to find what the usual way is to handle these problems: c++ 
Libraries for example?!






i don't know as i do not have that book... but since you have the 
three routines available, can you please post what they return for the 
two cases above??


I don't have my test app anymore, changed it a lot last days to follow 
the discussion, but perhaps you have a look at my post from 12.11.2013,  
21:56




[...]

Bart delivered code that calculates 29.02.2000 to 28.02.2001 = 1 Year.
And that looks reasonable to me!


but it is not, not really... 29.02 only comes around once every four 
years... 29.02.leapyear to 28.02.leapyear+1 is one day short of a 
year... if you were born on 29.02.1960, have you celebrated your 
birthday 13 or 53 times? :)


That depends on the country , you're living, see 
http://en.wikipedia.org/wiki/February_29#Births





Bart wrote:

I would actually say that in this particular case the diff is 1 Year...
(11 M + (28 days in feb in a non-leapyear = 1M) = 12M = 1 Y.
Soon we'll have working DateDiff function and my question will be 
answered in

the end!
Thanks guys!!


i can, however, agree with the reasoning bart has given above... do 
you agree with it? is that what you want to see?


I'm not the one to decide, but i need a function which provides widely 
accepted results!

I'll google again.



which of the following is what you want to see??

2000-02-29 to 2001-02-28 is0 yrs   11 mos   27 days (original)

2000-02-29 to 2001-02-28 is0 yrs   11 mos   28 days  (bart's fix)

2000-02-29 to 2001-02-28 is1 yrs0 mos0 days  (actually 
desired?)






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


Re: [Lazarus] DateDif function needed

2013-11-13 Thread John Landmesser

On 13.11.2013 18:31, waldo kitty wrote:

On 11/13/2013 9:37 AM, John Landmesser wrote:

On 13.11.2013 14:02, waldo kitty wrote:


We don't need to invent the wheel again, because others have 
solutions for that!


then why does this thread exist? O:)


I'll try to find what the usual way is to handle these problems: c++ 
Libraries

for example?!


i was being facetious thus the smiley ;)


Ok, i can't read them :--((


as far as not one to decide... on the contrary... you are the one to 
decide if a routine fits your purposes... as far as accepting a 
routine to be added to one of the libraries distributed with FPC 
and/or Lazarus, yeah, that's up to someone on those teams...



Background to my question about DateDiff():

I wrote a little app for my Win Box in office:

if i klick on it, windows shuts down; Space  klick reboots and F1  
klick shows me a message box, telling me how long i have to stay in 
Office to fullfill the 8 h 30 min working time. Now i have my pension, 
starting 01.08.2018 and i thought: would be nice to know in this message 
box how many Years, Month, days left?!!


That how the story begins ... and lazarus would be better, if there 
exists a function DateDiff.


Meanwhile i googled again and learned. 29.01.2000 until 28.01.2001 is 0 
Y 11 M and 30 D in Libereoffice and MS Office 360.


I' ll look later in my Win on this computer to look what MS Access 97 
tells me.


What about Databases like mysql, Oracle, Firebird. I'm shure they have 
such a function.


.. lots to search for .. hihi ... my cooking is ready ... see you :-))


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


Re: [Lazarus] DateDif function needed

2013-11-13 Thread John Landmesser

On 13.11.2013 23:14, Bart wrote:

On 11/13/13, John Landmesser joh...@online.de wrote:

I'm just a hobbyist, never went to university to study computer science.

So am I.
(For my background, see my userpage on the wiki)


Found your userpage , read it with great interest.
Your experience with Lazarus sounds fimiliar to me ( Delphi 5, Delphi 
2010 -- horrible ) and now Lazarus, that fits my needs!


I will use your version of DateDiff, thank you!!!

Perhaps it can become a part of FreePascal, that is missing such a 
function.


... the end of this thread is near?

.. perhaps.

I got an answer to my question.

Regards,

John

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


Re: [Lazarus] DateDif function needed

2013-11-12 Thread John Landmesser

On 12.11.2013 13:05, Bart wrote:


I proposed a solution in this thread.
It'll give you (at least that was the intention) the years, months,
and days between two (Gregorian) dates.

Bart

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


Hi Bart,

i found this in old RxLib ( now Yedi ).

Perhaps it inspires you.

procedure DateDiff(Date1, Date2: TDateTime; var Days, Months, Years: word);
var
  DtSwap: TDateTime;
  Day1, Day2, Month1, Month2, Year1, Year2: word;
begin
  if Date1  Date2 then
  begin
DtSwap := Date1;
Date1 := Date2;
Date2 := DtSwap;
  end;
  DecodeDate(Date1, Year1, Month1, Day1);
  DecodeDate(Date2, Year2, Month2, Day2);
  Years := Year2 - Year1;
  Months := 0;
  Days := 0;
  if Month2  Month1 then
  begin
Inc(Months, 12);
Dec(Years);
  end;
  Inc(Months, Month2 - Month1);
  if Day2  Day1 then
  begin
// von mir auskommentiert Inc(Days, DaysPerMonth(Year1, Month1));
Inc(Days, DaysInAMonth(Year1, Month1));
if Months = 0 then
begin
  Dec(Years);
  Months := 11;
end
else
  Dec(Months);
  end;
  Inc(Days, Day2 - Day1);
end;


My Tests showed: this procedure works well !

The next function seems also much better than that in DateUtil:

function MonthsBetween(Date1, Date2: TDateTime): Double;
var
  D, M, Y: Word;
begin
  DateDiff(Date1, Date2, D, M, Y);
  Result := 12 * Y + M;
  if (D  1) and (D  7) then Result := Result + 0.25
  else if (D = 7) and (D  15) then Result := Result + 0.5
  else if (D = 15) and (D  21) then Result := Result + 0.75
  else if (D = 21) then Result := Result + 1;
end;

Problem: it returns Double!!

I'll use these two and i think everything is ok?!!

happy hacking ...

John

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


Re: [Lazarus] DateDif function needed

2013-11-12 Thread John Landmesser

On 12.11.2013 21:01, waldo kitty wrote:

type
  Date_Diff = record
Years,
Months,
Days: Word;
  end;

function CalendarDateDiff(Date1,Date2: TDateTime): Date_Diff;
var
  theDiffRec: Date_Diff;
  Cmp: Integer;
  loDate,hiDate: TDateTime;
  loYear,hiYear,loMonth,hiMonth,loDay,hiDay: Word;
begin
  FillChar(theDiffRec,SizeOf(theDiffRec),0);  // init results to zero
  Cmp:=CompareDateTime(Date1,Date2);  // compare dates
  If Cmp0 then
  begin
loDate:= Date1;   // and set loDate to oldest
hiDate:= Date2;
  end
  else if Cmp0 then
  begin
loDate:= Date2;   // and set loDate to oldest
hiDate:= Date1;
  end;
  DecodeDate(loDate,loYear,loMonth,loDay);
  DecodeDate(hiDate,hiYear,hiMonth,hiDay);
  theDiffRec.Years:= hiYear - loYear;
  if (loMonth  hiMonth) or ((loMonth = hiMonth) and (loDay  hiDay)) 
then

  begin
theDiffRec.Years:= theDiffRec.Years - 1;
  end;
  if loMonth  hiMonth then
  begin
hiMonth:= hiMonth + 12;
  end;
  theDiffRec.Months:= hiMonth - loMonth;
  if hiDay = loDay then
  begin
theDiffRec.Days:= hiDay - loDay
  end
  else
  begin
if theDiffRec.Months = 0 then
begin
  theDiffRec.Months:= 11;
end
else
begin
  theDiffRec.Months:= theDiffRec.Months - 1;
end;
theDiffRec.Days:= DaysInAMonth(hiYear,loMonth) - loDay + hiDay;
  end;
  Result:= theDiffRec;
end; 


Which is correct?

Date1 := 29.2.2000
Date2 := 28.02.2001

Your function:
0 Y, 11 M, 27 D

Rxlib ( Jedi ) DateDiff:
0 Y, 11 M, 28 D

Libre Office Calc:
0 Y, 11 M, 30 D

The table - function of Libre Office Calc is called in german DATUMDIF()

Get a calendar and count??





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


Re: [Lazarus] DateDif function needed

2013-11-12 Thread John Landmesser

On 12.11.2013 21:40, John Landmesser wrote:


Which is correct?

Date1 := 29.2.2000
Date2 := 28.02.2001

Your function:
0 Y, 11 M, 27 D

Rxlib ( Jedi ) DateDiff:
0 Y, 11 M, 28 D

Libre Office Calc:
0 Y, 11 M, 30 D

The table - function of Libre Office Calc is called in german DATUMDIF()

Get a calendar and count??





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



*Jahr 2000* 

Januar  Tage
Februar 29  
März31  1. Monat
April   30  2. Monat
Mai 31  3. Monat
Juni30  4. Monat
Juli31  5. Monat
August  31  6. Monat
September   30  7. Monat
Oktober 31  8. Monat
November30  9. Monat
Dezember31  10. Monat



*Jahr 2001* 

Januar  31  11. Monat
Februar 28  


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


Re: [Lazarus] DateDif function needed

2013-11-11 Thread John Landmesser

On 11.11.2013 13:31, waldo kitty wrote:

On 11/11/2013 3:39 AM, Michael Schnell wrote:

On 11/08/2013 09:35 PM, John Landmesser wrote:


Result would be: 0 years, 0 moths, 11 days
IMHO a date diff in this format us desperately misleading, as the 
count of days

in a month varies.


understood but it is what many of us want for tasks of this nature... 
it means that one need know the numbers of days in the months between 
the dates so they can be properly counted... it also means knowing if 
a leap year is involved at some point...


the *Span routines may be able to give us this info since they have 
fractional parts but as the code notes, starting with years or months 
values will result in an estimation...




.. still struggeling with a function DateDif( ANow, AThen: TDateTime) : 
TDateTime


We have the functions YearsBetween, MonthsBetween, DaysBetween
and
YearSpan, MonthSpan, DaySpan

Test is: ANow := '01.01.2000'
AThen := '01.08..2001'

Result must(!!) be 1 year , 7 months, 0 days!!

I don't get it using mentioned functions?!!

I'll try again later :-((

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


Re: [Lazarus] DateDif function needed

2013-11-11 Thread John Landmesser

That's what i realized until now::

Quote of lhelp:
MonthsBetween returns the number of whole months between ANow and 
AThen. This number is an approximation, based on an average number of 
days of 30.4375


per month (average over 4 years). This means the fractional part of a 
month is dropped.



MonthsBetween('01.01.2000', '01.03.2000') = 1(!!)

This wrong(!!) result is according to the explanation in the lhelp file, 
but this function is useless if you have leapyears in your period.




Fazit:

You can't write a DateDif function with the functions in DateUtils.pas ?!!

Giving up and using the Jedi DateDif function.



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


Re: [Lazarus] DateDif function needed

2013-11-09 Thread John Landmesser

On 09.11.2013 06:55, leledumbo wrote:

   Date1 := EncodeDate(2012,12,21);
   Date2 := EncodeDate(2013,01,01);


Your code Result is: 1900 Years, 1 Month, 10 days and thats incorrect.

I thought about it some time and found a solution:

Think of the age of an employe! We have now() and his birthday.
How old is he in Years , Months and days?

my code:

uses DateUtils;

function TForm1.CalcDateDif(von, bis: TDateTime): String;
var
  Year, Month, Day: longint;
  YearVon, MonthVon, DayVon : word;
  YearBis, MonthBis, DayBis : word;

begin

  DecodeDate(von, YearVon, MonthVon, DayVon);
  DecodeDate(bis, YearBis, MonthBis, DayBis);

  // whole year:
   year := YearsBetween(von,bis);

  // How many months more than months in year
   Month := MonthsBetween(von,bis) - (year * 12);

  // Special case: December of previous year as von  and not a whole 
Month until bis: 21.12.2012 until 01.01.2013

  if  (YearBis - YearVon = 1) and (MonthVon = 12) then
   begin
 Day :=  DaysBetween(von,EndOfAYear(YearVon)) + DayOfTheYear(bis);
   end
   else
  Day := DaysBetween(EnCodeDate(YearBis,MonthVon, DayVon), bis) ;

Result := IntToStr(year) + ' Jahr(e) ';

 Result := Result + IntToStr(Month) + ' Monat(e) ';

Result := Result + IntToStr(Day) + ' Tag(e) ';

end;

// I have to test that later again, but i think thats ok now?!!
// Going jogging now :-))

But i'm really wondering that Freepascal does not have such a function?!!



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


Re: [Lazarus] DateDif function needed

2013-11-09 Thread John Landmesser

On 09.11.2013 14:32, leledumbo wrote:

Indeed that was wrong, I shouldn't exploit the internal details. Below is the
correct one (still no need for that complicated code of yours):

uses
   SysUtils,DateUtils;
var
   Date1,Date2: TDate;
   Y,M,D: Word;
begin
   Date1 := EncodeDate(2012,12,21);
   Date2 := EncodeDate(2013,01,01);
   Y := YearsBetween(Date1,Date2);
   M := MonthsBetween(Date1,Date2);
   D := DaysBetween(Date1,Date2);
   WriteLn(Y,'-',M,'-',D);
end.




--
View this message in context: 
http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-DateDif-function-needed-tp4034182p4034192.html
Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com.

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


please test your code: 21.12.2010(!!)   01.01.2013

My code is wrong too in this case :--((



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


Re: [Lazarus] DateDif function needed

2013-11-09 Thread John Landmesser

On 08.11.2013 21:35, John Landmesser wrote:

Hi List,

i'm searching a pascal datetime function that simulates an Excel 
function: DateDif


Excel for example knows the function DateDif that returns the number 
of Years, month and days between Date1 and date2.


Date1 := 21.12.2012
Date2 := 01.01.2013

Result would be: 0 years, 0 moths, 11 days

I tried to do it on my own, but without success.

But i think there is a function out there but i don't know its name :-((

Thanks for your tipps

John

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



Found a solution  in Jedi: /jvcl/run/JvJCLUtils.pas

procedure DateDiff(Date1, Date2: TDateTime; var Days, Months, Years: Word
  );
var
  DtSwap: TDateTime;
  Day1, Day2, Month1, Month2, Year1, Year2: Word;
begin
  if Date1  Date2 then
  begin
DtSwap := Date1;
Date1 := Date2;
Date2 := DtSwap;
  end;
  DecodeDate(Date1, Year1, Month1, Day1);
  DecodeDate(Date2, Year2, Month2, Day2);
  Years := Year2 - Year1;
  Months := 0;
  Days := 0;
  if Month2  Month1 then
  begin
Inc(Months, 12);
Dec(Years);
  end;
  Inc(Months, Month2 - Month1);
  if Day2  Day1 then
  begin
// von mir auskommentiert Inc(Days, DaysPerMonth(Year1, Month1));
Inc(Days, DaysInAMonth(Year1, Month1));
if Months = 0 then
begin
  Dec(Years);
  Months := 11;
end
else
  Dec(Months);
  end;
  Inc(Days, Day2 - Day1);
end;

**

Seems to calculate ok.
Now i'll try to understand what it is doing :-))


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


[Lazarus] DateDif function needed

2013-11-08 Thread John Landmesser

Hi List,

i'm searching a pascal datetime function that simulates an Excel 
function: DateDif


Excel for example knows the function DateDif that returns the number of 
Years, month and days between Date1 and date2.


Date1 := 21.12.2012
Date2 := 01.01.2013

Result would be: 0 years, 0 moths, 11 days

I tried to do it on my own, but without success.

But i think there is a function out there but i don't know its name :-((

Thanks for your tipps

John

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


Re: [Lazarus] Printing

2013-09-07 Thread John Meyer
Even if you find it out, always good to tell how you found it out so 
others see.


On 9/7/2013 3:22 PM, Terry A. Haimann wrote:

Never mind, I figured it out.

On Sat, 2013-09-07 at 15:58 -0500, Terry A. Haimann wrote:

What is the current documentation on printing?

I have an app, I am trying to update from an older version of Lazarus
and it appears to be dying when I hit Printer.BeginDoc;

It is creating a Sigsegv on line 504 of Printer.pas.

I also don't see a built in Report Generator, which I would also
consider using?

Thanks for your attention,

T.

I was using http://wiki.freepascal.org/Using_the_printer.


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



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



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


Re: [Lazarus] try finally exit

2013-06-28 Thread John Meyer
pray tell what does using a production machine have to do with testing a 
trivial section of code?

Junior wrote:

because I use a production machine

plese  be patiente!

Em 28-06-2013 17:34, Bart escreveu:
On 6/28/13, Junior lazarus.li...@gmail.com wrote:

strList.TStringList.Create;
try
if Pos('blablabla',strList.Text) = 0 then
  Exit;

finally
 strList.Free;
end;

Adding Exit, the finally is executed?


Just wondering. Why couldn't you test that yourself?

Bart

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




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



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


[Lazarus] test if the list is down, since 21.3.13 no mails?!!

2013-03-24 Thread John Landmesser



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


[Lazarus] Opening a file with spaces in the filename (again)

2013-03-05 Thread John

Hi List,

Using Laz 1.0.6, included fpc2.6.0 on win 7 - 32 bit:

I want to open a tiff file using what ever viewer the PC knows about 
that can do it (it will be irfanview on the test PC).  It seemed that 
OpenDocument  is the appropriate method.  This works fine so long as 
the path has no spaces, but OpenDocument calls OpenURL, and that 
converts the spaces to %20 s - which is fine for browsers, but fails at 
least for irfanview (and other programs (eg dir) from a command line).  
Quoting the file name does not seem to make any difference - the %20 s 
are still substituted.


I notice there was considerable discussion about this around bug 21659 
about a year ago, but I could not work out what the outcome was.


Am I using the right approach, or is there a better way to do it ? Or 
does this mean there is still a bug in OpenDocument ?


As far as I can remember, I have occasionally used OpenDocument to open 
a file (as opposed to a URL), and it should not be limited only to 
opening files in browsers.


thanks,
John Sunderland

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


Re: [Lazarus] Opening a file with spaces in the filename (again)

2013-03-05 Thread John

On 03/06/2013 04:49 AM, Bart wrote:

On 3/5/13, John jszc...@netspace.net.au wrote:


I want to open a tiff file using what ever viewer the PC knows about
that can do it (it will be irfanview on the test PC).  It seemed that
OpenDocument  is the appropriate method.  This works fine so long as
the path has no spaces, but OpenDocument calls OpenURL, and that
converts the spaces to %20 s

In trunk it does not replace spaces with %20.
This was reverted in r36934.
I see this in trunk, but not in release 1.0.6, which purports to be 
r40xxx ?  I upgraded when I saw the note about the reversion in the bug 
tracker.  (I usually work from trunk on my development PC, but I am 
doing this on a separate PC, and wanted to keep the install as simple as 
possible).


Anyway, I removed the clause that inserts the %20s, it all works fine, 
so I can leave it at that for now.

(This, of course, is the joy of open source software!)

However, I can't help thinking that the REAL problem is that probably 
there were originally an OpenURL and an OpenDocument for a reason.  
OpenURL could be optimised for URLs, OpenDocuments for file system 
documents.  OpenDocument could possibly look for a '://' and pass it off 
to OpenURL if it found one.


(Sorry, it is hard to keep up a conversation from GMT+11)

cheers,
John Sunderland

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


Re: [Lazarus] ValueListEditor: feedback needed from Delphi users

2013-02-27 Thread John Landmesser

Delphi 2010 Pro:

Per default property Keyoptions is empty and nothing  happens pressing 
insert, delete ...


You can only select the value and edit it.

Am 26.02.2013 19:03, schrieb Bart:

Hi all,

I'm currently working on the ValueListEditor.
I have some questions on the behaviour of the KeyOptions property that
I cannot find an answer to, simply because my Delphi is too old, and
it does not have a TValueListEditor at all, and the Embarcadero
DocWiki 
(http://docwiki.embarcadero.com/Libraries/XE3/en/Vcl.ValEdit.TKeyOptions)
doesn't provide clear answers either.

So, for anyone that has a recent Delphi here are my questions:

1)
keyDelete: The user can delete the selected name/value pair by
pressing the Delete key.

When does this happen.
- If the user presses Delete in key column, or also in value column?
If property keyoptions is [keyEdit,keyAdd,keyDelete,keyUnique] and you 
press Control plus keyDelete, the whole line is deleted. Doesn't matter 
which column is selected!

- Does it happen if the user is editing the cell (if keyEdit is set)?

YES !!!


2)
keyDelete: the Embarcadero docwiki does not specify: must keyEdit be
set in order to set keyDelete (like it is, for keyAdd)?

keyDelete can  be set, even if keyedit is false !


3)
keyAdd: if the user presses Insert, an empty row is added.
(first attempt at implementing this in r40418)
- if you are in an empty row, does it still insert a new one?

No !
You just hit the insert key and get ONE new row next to current row.


Please only provide answer obtained by black box testing. Just build
a Delpi app and see how it functions.
Do NOT, I repeat do NOT, look at the Delphi source code.
Our implementation needs to be clean.

Thanks in advance.

Bart

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



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


Re: [Lazarus] Append or Insert?

2013-02-20 Thread John

On 02/20/2013 09:21 PM, Junior wrote:

What better use?

Using SQLite3. How to record in the table?


You haven't given us a lot to go on!

If you are inserting or appending into an indexed table, as far as I 
know it doesn't make any difference.  (And ALL sql tables should be 
indexed).  I usually use append.  I think on some tables insert attempts 
to insert a record into the current location, but this doesn't make any 
sense in sql, and probably isn't possible.


Very basically, using sqldb components, you insert a record, post the 
insert to the query, apply updates on the query, then commit the 
transaction.  But I will leave detailed descriptions to someone who 
knows SQLIte - I have always had trouble with it.


There is heaps of information on the wiki, see eg 
http://wiki.lazarus.freepascal.org/Databases


hope this helps a bit
John Sunderland

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


[Lazarus] trunk compile error Win XP : Error: identifier idents no member StrikeThrough

2013-01-23 Thread John Landmesser

Hi,

i cannot compile actual lazarus trunk version:

Stops here:

procedure TLazCanvas.AssignFontData(AFont: TFPCustomFont);
begin
  if AFont = nil then Exit;
  Font.FPColor := AFont.FPColor;
  Font.Name := AFont.Name;
  Font.Size := AFont.Size;
  Font.Bold := AFont.Bold;
  Font.Italic := AFont.Italic;
  Font.Underline := AFont.Underline;
  {$IF (FPC_FULLVERSION=20601) or (FPC_FULLVERSION=20701)} //changed 
in 2.6.1 and 2.7; remove when FPC 2.6.2+ only is supported

  Font.StrikeThrough := AFont.StrikeThrough;
  {$ELSE}
  Font.StrikeTrough := AFont.StrikeTrough; //old version with typo
  {$ENDIF}
end;

error message is:

C:\lazarus\lcl\lazcanvas.pas(765,8) Error: identifier idents no member 
StrikeThrough



Lazarus:

Lazarus 1.1 r39792 FPC 2.6.1 i386-win32-win32/win64

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


Re: [Lazarus] trunk compile error Win XP : Error: identifier idents no member StrikeThrough

2013-01-23 Thread John Landmesser

Am 23.01.2013 15:56, schrieb Vincent Snijders:

Is your fpc 2.6.1 version up to date?

Vincent



Thanks for this tipp, now it compiles ok!

But:
I had fpc 2.6.1 from 2012 and now i extracted fpc 2.6.1 from a snapshot.

There are differences between 2.6.1 and 2.6.1 ???

I have to keep that in mind!



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


Re: [Lazarus] Can't create calculated field

2012-12-30 Thread John Landmesser

In Delphi 5 i would give you this advice; perhaps update the FieldList?!

 SQLQuery1.FieldDefs.Clear;

.. add  your Field ..

SQLQuery1.FieldDefs.Update;



Am 30.12.2012 15:26, schrieb Krzysztof:

Hi,

I have this code:

  f := TField.Create(FDataList);
  f.FieldName := 'calc';
  f.FieldKind := fkCalculated;
  f.SetFieldType(ftBoolean);
  f.DataSet   := SQLQuery1.FieldDefs.Dataset;


procedure TForm1.OnCalc(DataSet: TDataSet);
begin
  SQLQuery1.FieldByName('calc').AsBoolean := true;
end;

But I get error Invalid type conversion to Boolean in field calc

Regards


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


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


  1   2   3   >