Re: [fpc-pascal] SysUtils.GetEnvironmentVariable

2012-03-30 Thread Bart
On 3/29/12, Marcos Douglas m...@delfire.net wrote:

 The application is installed and the system variable is created.

How exactly is this done?

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


Re: [fpc-pascal] SysUtils.GetEnvironmentVariable

2012-03-30 Thread Marcos Douglas
On Fri, Mar 30, 2012 at 5:43 AM, Bart bartjun...@gmail.com wrote:
 On 3/29/12, Marcos Douglas m...@delfire.net wrote:

 The application is installed and the system variable is created.

 How exactly is this done?

I'm not responsible for this part but I'm sure that works.

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


Re: [fpc-pascal] SysUtils.GetEnvironmentVariable

2012-03-30 Thread Marcos Douglas
On Thu, Mar 29, 2012 at 11:49 PM, waldo kitty wkitt...@windstream.net wrote:
 On 3/29/2012 21:26, Marcos Douglas wrote:

 Thanks for the test.
 We have a little difference: my FPC is 2.6.1 (svn /fixes_2_6).
 The env variable was added before I start the application, always.


 and this is from command line (cmd.exe, command.exe or *shell) ??

 or in the user or system environment? i'm just trying to keep up ;)

System environment.

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


[fpc-pascal] Win64 and currency

2012-03-30 Thread LacaK

Hi *,
I encounter strange thing under FPC 2.7.1 and Win64 target.
Can anybody test this program:

const
 test: array[0..0] of currency = (-10);
var
 c:currency;

begin
 c := -10;
 writeln(c);
 writeln(test[0]);
 readln;
end.


Results:
-1.00E+01
-1.00E-03

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


[fpc-pascal] Is there a function that returns UTC time in FPC or Lazarus?

2012-03-30 Thread Frank Church
When I get the time via the DateTime function result is adapted for
the timezone, making it an hour ahead now?

Is there a function that returns the UTC time, either as a UnixTime or
TDateTime irregardless of timezone?

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


RE: [fpc-pascal] Win64 and currency

2012-03-30 Thread Pierre Free Pascal
Confirmed,
  if you usee -Aas and -al
you will see that
TEST
is just .quad -10
which is wrong of course...
  Using -10.0 fixes the bug for now if
you really need this correct fast.

  It would be nice if you could submit a bug report.

Pierre Muller

 -Message d'origine-
 De : fpc-pascal-boun...@lists.freepascal.org [mailto:fpc-pascal-
 boun...@lists.freepascal.org] De la part de LacaK
 Envoyé : vendredi 30 mars 2012 14:09
 À : FPC-Pascal users discussions
 Objet : [fpc-pascal] Win64 and currency
 
 Hi *,
 I encounter strange thing under FPC 2.7.1 and Win64 target.
 Can anybody test this program:
 
 const
   test: array[0..0] of currency = (-10);
 var
   c:currency;
 
 begin
   c := -10;
   writeln(c);
   writeln(test[0]);
   readln;
 end.
 
 
 Results:
 -1.00E+01
 -1.00E-03
 
 Thanks
 -Laco.
 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-pascal

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


Re: [fpc-pascal] Win64 and currency

2012-03-30 Thread Marco van de Voort
In our previous episode, Pierre Free Pascal said:
   if you usee -Aas and -al
 you will see that
 TEST
 is just .quad -10
 which is wrong of course...
   Using -10.0 fixes the bug for now if
 you really need this correct fast.
 
   It would be nice if you could submit a bug report.

Note that #21091 is also about win64 and currency.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Re: Is there a function that returns UTC time in FPC or Lazarus?

2012-03-30 Thread Reinier Olislagers
On 30-3-2012 16:05, Frank Church wrote:
 When I get the time via the DateTime function result is adapted for
 the timezone, making it an hour ahead now?
 
 Is there a function that returns the UTC time, either as a UnixTime or
 TDateTime irregardless of timezone?
 
Frank,

You could search the fpc and lazarus mailing list; I know there've been
posts regarding this.
IIRC, the conclusion was that doing this is potentially very difficult
to do cross platform, keeping daylight saving changes etc in mind.

There is a separate unit that deals with this, IIRC, the wiki mentions
it somewhere..

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


Re: [fpc-pascal] Custom assignment operators

2012-03-30 Thread Sven Barth
Am 30.03.2012 17:40 schrieb Mark Morgan Lloyd 
markmll.fpc-pas...@telemetry.co.uk:

 A few weeks ago somebody (Martin?) suggested I got round an endianness
issue by doing this:

 typeWordLE= packed record b0, b1: byte; end;

 operator := (wle: WordLE): word;

 begin
 ..

 It works well, except that attempting to use an assignment inside the
operator definition immediately recurses: I've fixed this by using Move(),
with operand sizes check by assertion.

 Is it possible to tell the compiler that, for a code fragment like this,
it is under no circumstances to attempt any implicit type conversions?

No, there is no possibility. But why dies it try to do a type conversion in
the first place? Can you show your code please?

Also operator overloads should be considered from great power comes great
responsibility.

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

Re: [fpc-pascal] Re: Is there a function that returns UTC time in FPC or Lazarus?

2012-03-30 Thread waldo kitty

On 3/30/2012 15:31, Reinier Olislagers wrote:

On 30-3-2012 16:05, Frank Church wrote:

When I get the time via the DateTime function result is adapted for
the timezone, making it an hour ahead now?

Is there a function that returns the UTC time, either as a UnixTime or
TDateTime irregardless of timezone?


Frank,

You could search the fpc and lazarus mailing list; I know there've been
posts regarding this.
IIRC, the conclusion was that doing this is potentially very difficult
to do cross platform, keeping daylight saving changes etc in mind.


agreed... even in the TP/BP6/7 days... it depends on the setting of the local 
clock as to whether you to daylight saving display or not... i know of many that 
operate on UTC and do not do local time when viewing... it can be done but it is 
going to be a trick ;)

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