Re: [Lazarus] Date value "0"

2015-05-27 Thread Michael Van Canneyt



On Wed, 27 May 2015, Sven Barth wrote:



Am 26.05.2015 15:28 schrieb "Michael Schnell" :
>
> On 05/26/2015 01:30 PM, Juha Manninen wrote:
>>
>> Is there some convention how to show a date value "0"?
>> By default it shows year 1899. The patch changed it to "?".
>>
>
> Both funny, as DateTimeToStr(2.0) is "1-1-00" ;-)

Why should that be funny? TDateTime(0.0) is defined as "12/30/1899 12:00 am". Now add two 
days and we are at "1/1/1900 12:00 am", so all is well...


Does 12:00 am actually exist ? If so, what is that ? Midnight or midday ?
Should not that be 00:00 am ? (or is that the same ?)

Michael.

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


Re: [Lazarus] Date value "0"

2015-05-27 Thread Sven Barth
Am 27.05.2015 09:19 schrieb "Michael Van Canneyt" :
>
>
>
> On Wed, 27 May 2015, Sven Barth wrote:
>
>>
>> Am 26.05.2015 15:28 schrieb "Michael Schnell" :
>> >
>> > On 05/26/2015 01:30 PM, Juha Manninen wrote:
>> >>
>> >> Is there some convention how to show a date value "0"?
>> >> By default it shows year 1899. The patch changed it to "?".
>> >>
>> >
>> > Both funny, as DateTimeToStr(2.0) is "1-1-00" ;-)
>>
>> Why should that be funny? TDateTime(0.0) is defined as "12/30/1899 12:00
am". Now add two days and we are at "1/1/1900 12:00 am", so all is well...
>
>
> Does 12:00 am actually exist ? If so, what is that ? Midnight or midday ?
> Should not that be 00:00 am ? (or is that the same ?)

Honestly I don't know, as I simply copy-pasted the value mentioned by Mark,
since I'm on mobile and thus a bit lazy ;)

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


Re: [Lazarus] Date value 0

2015-05-27 Thread Kamen Ketev
 
How can I use

  TDateTime for date before
  

  "12/30/1899 12:00 am". I need it for astronomical calculations. Is it 
possible to be add flag or something else to ignore this border?
  

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


Re: [Lazarus] Date value 0

2015-05-27 Thread Michael Van Canneyt



On Wed, 27 May 2015, Kamen Ketev wrote:



How can I use  TDateTime for date before  "12/30/1899 12:00 am". I need it for 
astronomical calculations. Is it possible to be add flag or something else to ignore this 
border? 


You can use TDateTime for this, there is no problem with values < 0.

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


Re: [Lazarus] Date value "0"

2015-05-27 Thread Mattias Gaertner
On Wed, 27 May 2015 09:19:42 +0200 (CEST)
Michael Van Canneyt  wrote:

>[...]
> Does 12:00 am actually exist ? If so, what is that ? Midnight or midday ?
> Should not that be 00:00 am ? (or is that the same ?)

You are not alone with such questions:
https://en.wikipedia.org/wiki/12-hour_clock#Confusion_at_noon_and_midnight

Mattias

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


Re: [Lazarus] Date value "0"

2015-05-27 Thread Gordon Cooper

We were taught that 24.00 did not exist. Time went from 23.59
to 00.00.  The same rule can be applied to 11.59 am & pm.

Gordon.


On 27/05/15 19:57, Mattias Gaertner wrote:

On Wed, 27 May 2015 09:19:42 +0200 (CEST)
Michael Van Canneyt  wrote:


[...]
Does 12:00 am actually exist ? If so, what is that ? Midnight or midday ?
Should not that be 00:00 am ? (or is that the same ?)

You are not alone with such questions:
https://en.wikipedia.org/wiki/12-hour_clock#Confusion_at_noon_and_midnight

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


Re: [Lazarus] Date value "0"

2015-05-27 Thread Michael Schnell

On 05/27/2015 12:59 AM, Sven Barth wrote:


Why should that be funny? TDateTime(0.0) is defined as "12/30/1899 
12:00 am". Now add two days and we are at "1/1/1900 12:00 am", so all 
is well...


To me (being born 12/31) it's funny that that the base is not a 1/1, 
especially 1/1/0001. But of course this is completely irrelevant.


-Michael

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


Re: [Lazarus] Date value 0

2015-05-27 Thread Kamen Ketev
 
Yes but there is an error on converting date before   12/30/1899: it add 1 day. 
For example 27.09.1389 converts to
  
  28.09.1389. For date after
  
  12/30/1899   there is no problem.   I am using following code:  



 
var s, S1: string; dt: TDateTime; 
  S1 := ListItem.SubItems[1]; S1 := trim(S1);
  dt := StrtoDate(s) + StrToTime(S1);
s := FormatDateTime('dd.mm. hh.nn.ss', dt);
  with Form1 do Begin
year.Text  := copy(s, 7, 4);
  month.Text := copy(s, 4, 2);
  day.Text   := copy(s, 1, 2);  
Or something wrong in my code? 
Regards,
Kamen
 




 Оригинално писмо 
От:  Michael Van Canneyt  
Относно: Re: [Lazarus] Date value 0
До: Lazarus mailing list  
Изпратено на: Сряда, 2015, Май 27 10:55:23 EEST






On Wed, 27 May 2015, Kamen Ketev wrote:



> 

> How can I use
 TDateTime for date before
 "12/30/1899 12:00 am". I need it for astronomical calculations. Is it possible 
to be add flag or something else to ignore this border?




You can use TDateTime for this, there is no problem with values < 0.



Michael.

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


Re: [Lazarus] Date value 0

2015-05-27 Thread Michael Schnell

For me it works as expcted


var t: TDateTime;
i: integer;
s1, s2, s3, s4 : String;
begin

t := StrToDate('30-12-1899');
i := round (t);
s1 := DateTimeToStr(t);
s2 := IntToStr(i);
t := StrToDate('29-12-1899');
i := round (t);
s3 := DateTimeToStr(t);
s4 := IntToStr(i);
Memo1.Lines.Add (s1 + '   ' + s2 + '   ' + s3 + '   ' + s4);


provides
30-12-99   0   29-12-99   -1

-Michael


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


Re: [Lazarus] Date value "0"

2015-05-27 Thread Graeme Geldenhuys
On 2015-05-27 08:19, Michael Van Canneyt wrote:
> Does 12:00 am actually exist ? If so, what is that ? Midnight or midday ?

Hence I stick to 24 hour time. ;-)

Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

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


Re: [Lazarus] Date value "0"

2015-05-27 Thread Mark Morgan Lloyd

Gordon Cooper wrote:

We were taught that 24.00 did not exist. Time went from 23.59
to 00.00.  The same rule can be applied to 11.59 am & pm.


Except where there's a leap second.

> The same rule can be applied to 11.59 am & pm.

No it can't. You have to be prepared to parse 12:00 a.m. by context but 
it's usually midnight.


This is a deeply messy area, not helped at all by the odd conventions 
adopted by some of the early RTC chips which still turn up in embedded 
equipment.




Gordon.


On 27/05/15 19:57, Mattias Gaertner wrote:

On Wed, 27 May 2015 09:19:42 +0200 (CEST)
Michael Van Canneyt  wrote:


[...]
Does 12:00 am actually exist ? If so, what is that ? Midnight or 
midday ?

Should not that be 00:00 am ? (or is that the same ?)

You are not alone with such questions:
https://en.wikipedia.org/wiki/12-hour_clock#Confusion_at_noon_and_midnight 



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



--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

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


Re: [Lazarus] Date value "0"

2015-05-27 Thread Graeme Geldenhuys
On 2015-05-27 09:17, Michael Schnell wrote:
> To me (being born 12/31) it's funny that that the base is not a 1/1, 
> especially 1/1/0001. But of course this is completely irrelevant.

TDateTime's value of 0 being 1899-12-30 is something Borland adopted
from Microsoft to be compatible with Microsoft's Excel or Access. And in
turn Microsoft Excel tried to be compatible with Lotus 1-2-3. Back in
the 90's I searched the internet for the explanation, but can't remember
the details any more.

A quick google search now revealed this page, though it doesn't go into
much detail.

"It appears that the reason for Delphi starting at 30 Dec 1899 is to
make it as compatible as possible with Excel while at the same time not
adopting Excel's incorrectness about dates."
  [http://www.delphibasics.co.uk/RTL.asp?Name=TDateTime]


Do an internet search for "Microsoft date starts at 1899-12-30" and
you'll find a lot more information.

Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

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


Re: [Lazarus] Date value "0"

2015-05-27 Thread Michael Schnell

On 05/27/2015 11:05 AM, Mark Morgan Lloyd wrote:



No it can't. You have to be prepared to parse 12:00 a.m. by context 
but it's usually midnight.



Of which day the one that also has 0:pm or of the previous ?

-Michael

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


Re: [Lazarus] Date value "0"

2015-05-27 Thread Mark Morgan Lloyd

Michael Schnell wrote:

On 05/27/2015 11:05 AM, Mark Morgan Lloyd wrote:



No it can't. You have to be prepared to parse 12:00 a.m. by context 
but it's usually midnight.



Of which day the one that also has 0:pm or of the previous ?


Wp "12-hour clock" shows 11:59 p.m. followed by 12:00 a.m., but I'm not 
100% confident in this and sometimes you just have to guess :-)


Of course there's the interesting case where there's a leap second as 
well, because anybody foolish enough to insist on the 12 hour clock 
would see something like 11:59:59 11:59:60 p.m. 12:00:00 a.m.


Anybody with the least bit of sense uses ISO-8601 and 24-hour clock, but 
it's still possible to get into deep water when one gets things like 
astronomical observations or timezone offsets. Unfortunately there's a 
lot of legacy data and embedded kit floating around where timestamps are 
reported as BCD plus flag bits, and in particular there's things like 
(derivatives of) the 146818 chip which are both buggy and flexible 
enough that a firmware writer can make every conceivable bad decision 
leaving a heck of a mess for the poor so-and-do who has to make sense of 
logged data remotely.


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

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


Re: [Lazarus] Date value "0"

2015-05-27 Thread Mark Morgan Lloyd

Juha Manninen wrote:

Amazing! Nobody actually looked at the Mantis report nor the patch I
referred to, but still answered the mail.
The question is about LastUsed date of a Lazarus package link, shown
in one of the IDE's dialog windows.
Value "0" is wrong in this context because nobody created Lazarus
packages nor links between them at year 1899.
I leave it as "?", I guess there is no convention for such situations.

.. but people please pay a little more attention before answering ...


Mea culpa. But this sort of thing bites me so often that it's something 
I'm touchy about.


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

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


Re: [Lazarus] Date value 0

2015-05-27 Thread Kamen Ketev
 
It works only if you don't use time. Please look at example:
 
var t, dt: TDateTime;
 i: integer;
 s1, s2, s3, s4, s5, s6 : String;
 begin

 t := StrToDate('30.12.1899');
 i := round (t);
 s1 := DateTimeToStr(t);
 s2 := IntToStr(i);
 t := StrToDate('29.12.1899');
 i := round (t);
 s3 := DateTimeToStr(t);
 s4 := IntToStr(i);
 dt := StrToDate('29.12.1700') + StrToTime('18:00:55');
 s5 := FormatDateTime('dd.mm. hh.nn.ss', dt);
 s6 := IntToStr(i);
 Memo1.Lines.Add (s1 + ' ' + s2 + ' ' + s3 + ' ' + s4 + ' ' + s5 + ' ' + s6); 

 provides
30.12.1899 0 29.12.1899 -1 30.12.1700 05.59.05 -1
Date add 1 day, time not correct
  
If you change date to 29.12.1900 it is ok:
30.12.1899 0 29.12.1899 -1 29.12.1900 18.00.55 -1
 
If you change date to 29.12.1700 and time to '8:00:55' provides:
30.12.1899 0 29.12.1899 -1 30.12.1700 15.59.05 -1
 
If you change date to 29.12.1900 and time to '8:00:55' provides ok:

30.12.1899 0 29.12.1899 -1 29.12.1900 08.00.55 -1 
If you change date to 29.12.19 and time to '8:00:55' provides: 

29.12.2019 08.00.55 -1 
 (not 19 year)
 
If you change date to 29.12.0019 and time to '8:00:55' provides:
30.12.0019 15.59.05 -1
Year is ok, but date and time not. But how I can add value in TSpinEdit 0019? I 
am using it because in components TDateEdit, TDateTimePicker date must be 
between 24.9.1752 and 31.12..
 
If you change date to 29.12.-1900: EConvertError: not a valid date format. How 
can I use date before  year? 
Regards,
Kamen
 




 Оригинално писмо 
От:  Michael Schnell  
Относно: Re: [Lazarus] Date value 0
До: lazarus@lists.lazarus.freepascal.org
Изпратено на: Сряда, 2015, Май 27 11:44:17 EEST


For me it works as expcted





var t: TDateTime;

 i: integer;

 s1, s2, s3, s4 : String;

begin



t := StrToDate('30-12-1899');

i := round (t);

s1 := DateTimeToStr(t);

s2 := IntToStr(i);

t := StrToDate('29-12-1899');

i := round (t);

s3 := DateTimeToStr(t);

s4 := IntToStr(i);

Memo1.Lines.Add (s1 + '   ' + s2 + '   ' + s3 + '   ' + s4);





provides

30-12-99   0   29-12-99   -1



-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] Date value 0

2015-05-27 Thread Kamen Ketev
 
May be using Julian day is better. Or intermediate conversion to it.
 
http://en.wikipedia.org/wiki/Julian_day 
Regards,
Kamen
 




 Оригинално писмо 
От:  Michael Schnell  
Относно: Re: [Lazarus] Date value  0 
До: Lazarus mailing list  
Изпратено на: Сряда, 2015, Май 27 11:17:06 EEST


On 05/27/2015 12:59 AM, Sven Barth wrote:

>

> Why should that be funny? TDateTime(0.0) is defined as "12/30/1899 

> 12:00 am". Now add two days and we are at "1/1/1900 12:00 am", so all 

> is well...

>

To me (being born 12/31) it's funny that that the base is not a 1/1, 

especially 1/1/0001. But of course this is completely irrelevant.



-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] LazReport Questions

2015-05-27 Thread Jesus Reyes A.

En Mon, 25 May 2015 21:39:41 -0500, steveg  escribió:


Thank you Michael.

I have then following problems currently -

1:
I am placing a subreport in a Group footer (to run a charges query for  
each client in group break)
It would appear that the subreport is run 'after' accessing all other  
fields in the footer, no matter what it is named, or where it is  
placed.  I would like to be able to specify when it runs in relation to  
the other fields (to be able to use it for further calculations).

Is this at all possible ?


Is not possible in current implementation. Name or Position (x,y) have no
effect, however "z-order" (relative position between objects) might help.
It even seems that as soon a subreport is found any remaining object is  
skipped.




2:
All objects seem to be accessed in the order they are saved in the lrf  
file, not by Name (alpha) or position - this makes it problematic when  
using them for calculations.
Is it possible to have the running report fill in the fields by alpha  
name position instead ?


Not in the current implementation.



3:
Deleting an object from a report (memo / band / subreport) will often  
cause the program to abort.
I haven't yet been able to conclude precisely what its related to, but  
still watching.

Does anybody else have this issue ?



I haven't seen it. Feel free to submit a bug report with a sample project.

Jesus Reyes A.

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


Re: [Lazarus] Date value "0"

2015-05-27 Thread waldo kitty

On 05/27/2015 03:19 AM, Michael Van Canneyt wrote:


Does 12:00 am actually exist ? If so, what is that ? Midnight or midday ?
Should not that be 00:00 am ? (or is that the same ?)


yes... 12:00am is midnight... 00:00am is the same... so also is 00:00 or 24:00 
in 24hour time...


--
 NOTE: No off-list assistance is given without prior approval.
   Please *keep mailing list traffic on the list* unless
   private contact is specifically requested and granted.

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


[Lazarus] Getting common documents folders

2015-05-27 Thread Richard Mace
Hi All,
I need to use/get a common windows folder (in Win XP,Vista,7,8 and 8.1)
that all users will have read/write access to by default.
I think it is CSIDL_COMMON_DOCUMENTS

Any ideas how I can code this in Lazarus?

Many thanks

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


Re: [Lazarus] Getting common documents folders

2015-05-27 Thread Glaucos Ginez
Hi, you can use GetEnvironmentVariable('LocalAppData')

2015-05-27 14:53 GMT-04:00 Richard Mace :

> Hi All,
> I need to use/get a common windows folder (in Win XP,Vista,7,8 and 8.1)
> that all users will have read/write access to by default.
> I think it is CSIDL_COMMON_DOCUMENTS
>
> Any ideas how I can code this in Lazarus?
>
> Many thanks
>
> Richard
>
> --
> ___
> 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] Getting common documents folders

2015-05-27 Thread Bart
On 5/27/15, Richard Mace  wrote:

> Hi All,
> I need to use/get a common windows folder (in Win XP,Vista,7,8 and 8.1)
> that all users will have read/write access to by default.
> I think it is CSIDL_COMMON_DOCUMENTS

Copied from winlazfileutils.inc (used by LazFieUtils unit):

Procedure InitDLL;
Var
  pathBuf: array[0..MAX_PATH-1] of char;
  pathLength: Integer;
begin
  { Load shfolder.dll using a full path, in order to prevent spoofing
(Mantis #18185)
Don't bother loading shell32.dll because shfolder.dll itself
redirects SHGetFolderPath
to shell32.dll whenever possible. }
  pathLength:=GetSystemDirectory(pathBuf, MAX_PATH);
  if (pathLength>0) and (pathLength0) then
begin
  
Pointer(ShGetFolderPathW):=GetProcAddress(CFGDLLHandle,'SHGetFolderPathW');
  If @ShGetFolderPathW=nil then
  begin
FreeLibrary(CFGDLLHandle);
CFGDllHandle:=0;
  end;
end;
  end;
  If (@ShGetFolderPathW=Nil) then
Raise Exception.Create('Could not determine SHGetFolderPathW Function');
end;

function GetWindowsSpecialDirW(ID :  Integer) : String;
Var
  APath : Array[0..MAX_PATH] of WideChar;
  WS: WideString;
  Len: SizeInt;
begin
  Result := '';
  if (CFGDLLHandle = 0) then
InitDLL;
  If (SHGetFolderPathW <> Nil) then
  begin
FillChar(APath{%H-}, SizeOf(APath), #0);
if SHGetFolderPathW(0,ID or CSIDL_FLAG_CREATE,0,0,@APATH[0]) = S_OK then
begin
  Len := StrLen(APath);
  SetLength(WS, Len);
  System.Move(APath[0], WS[1], Len * SizeOf(WideChar));
  Result := AppendPathDelim(Utf16ToUtf8(WS));
end;
  end
  else
Result := SysToUtf8(GetWindowsSpecialDir(ID)); //<< only needed for Win9x
end;

Bart

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


Re: [Lazarus] Getting common documents folders

2015-05-27 Thread Michael Van Canneyt



On Wed, 27 May 2015, Glaucos Ginez wrote:


Hi, you can use GetEnvironmentVariable('LocalAppData')

2015-05-27 14:53 GMT-04:00 Richard Mace :
  Hi All,
I need to use/get a common windows folder (in Win XP,Vista,7,8 and 8.1) that 
all users will have
read/write access to by default.
I think it is CSIDL_COMMON_DOCUMENTS

Any ideas how I can code this in Lazarus?


You can use the shfolder unit. It contains the necessary constants and
calls to retrieve the location.

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


Re: [Lazarus] Getting common documents folders

2015-05-27 Thread silvioprog
On Wed, May 27, 2015 at 6:21 PM, Michael Van Canneyt  wrote:
>
>
> On Wed, 27 May 2015, Glaucos Ginez wrote:
>
>  Hi, you can use GetEnvironmentVariable('LocalAppData')
>>
>> 2015-05-27 14:53 GMT-04:00 Richard Mace :
>>   Hi All,
>> I need to use/get a common windows folder (in Win XP,Vista,7,8 and 8.1)
>> that all users will have
>> read/write access to by default.
>> I think it is CSIDL_COMMON_DOCUMENTS
>>
>> Any ideas how I can code this in Lazarus?
>>
>
> You can use the shfolder unit. It contains the necessary constants and
> calls to retrieve the location.
>
> Michael.


Here in Brazil, on Lazarus-BR group, an member (Joao Marcelo Vaz) sent an
very nice tip:

uses
  windirs;

...

  ShowMessage(GetWindowsSpecialDir(CSIDL_COMMON_DOCUMENTS));

=)

-- 
Silvio Clécio
My public projects - github.com/silvioprog
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] LazReport Questions

2015-05-27 Thread steveg

Thank you Jesus
  I will attempt workarounds a I can, and will try to narrow down the 
'delete' cause



On 27/05/15 23:29, Jesus Reyes A. wrote:
En Mon, 25 May 2015 21:39:41 -0500, steveg  
escribió:



Thank you Michael.

I have then following problems currently -

1:
I am placing a subreport in a Group footer (to run a charges query 
for each client in group break)
It would appear that the subreport is run 'after' accessing all other 
fields in the footer, no matter what it is named, or where it is 
placed.  I would like to be able to specify when it runs in relation 
to the other fields (to be able to use it for further calculations).

Is this at all possible ?


Is not possible in current implementation. Name or Position (x,y) have no
effect, however "z-order" (relative position between objects) might help.
It even seems that as soon a subreport is found any remaining object 
is skipped.




2:
All objects seem to be accessed in the order they are saved in the 
lrf file, not by Name (alpha) or position - this makes it problematic 
when using them for calculations.
Is it possible to have the running report fill in the fields by alpha 
name position instead ?


Not in the current implementation.



3:
Deleting an object from a report (memo / band / subreport) will often 
cause the program to abort.
I haven't yet been able to conclude precisely what its related to, 
but still watching.

Does anybody else have this issue ?



I haven't seen it. Feel free to submit a bug report with a sample 
project.


Jesus Reyes A.

--
___
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