[fpc-pascal] Syncobjs Event and BlockWrite() question

2017-08-01 Thread Brian
When using WaitFor() , ResetEvent and SetEvent as a semaphore , if a thread
is using BlockWrite() and the execution of BlockWrite() is conditional on 
WaitFor() , will BlockWrite() continue to function after it is called once
MySemaphore.ResetEvent is called ?

A pseudo code  example below

-main loop-- 
MySemaphore.ResetEvent;

 doing something

MySemaphore.SetEvent
 
 - Thread
  MySemaphore.WaitFor(10);

  BlockWrite()

-

Thanks
Brian




--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Syncobjs-Event-and-BlockWrite-question-tp5729411.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] why the 0.5 in the Unix Epoch (for UnixToDateTime function)

2017-08-01 Thread Mark Morgan Lloyd

On 01/08/17 12:15, Dennis Poon wrote:

Vojtěch Čihák wrote:>> Hi,>> wiki
https://en.wikipedia.org/wiki/Julian_day says that "... Julian > day
number 0 assigned to the day starting at noon on January 1, 4713 > BC,
...">> The noon means 0,5.>Thanks,that is a weird definition though IMHO.


Astronomer's convention.

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

[Opinions above are the author's, not those of his employers or colleagues]
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Is it always safe to typecast a old style object as its parent?

2017-08-01 Thread Dennis



TParent = object
   A : integer;
end;

TChild=object(TParent)
   B : integer;
end;


var
   Parent : TParent;
   Child : TChild;


 begin

Child.A := 10;
Child.B := 20;

Parent := TParent(Child );//  is this always safe ? Will it copy 
ONLY the 'A'  field to 'parent'?  Will it overwrite some memory space 
beyond the legitimate boundary of 'parent'?


end.


Thanks a lot in advance.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] why the 0.5 in the Unix Epoch (for UnixToDateTime function)

2017-08-01 Thread Dennis Poon



Vojtěch Čihák wrote:


Hi,

wiki https://en.wikipedia.org/wiki/Julian_day says that "... Julian 
day number 0 assigned to the day starting at noon on January 1, 4713 
BC, ..."


The noon means 0,5.


Thanks,
that is a weird definition though IMHO.

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

Re: [fpc-pascal] why the 0.5 in the Unix Epoch (for UnixToDateTime function)

2017-08-01 Thread Vojtěch Čihák

Hi,
 
wiki https://en.wikipedia.org/wiki/Julian_day says that "... Julian day number 0 
assigned to the day starting at noon on January 1, 4713 BC, ..."
The noon means 0,5.
 
V.
__

Od: Dennis 
Komu: FPC-Pascal users discussions 
Datum: 01.08.2017 13:14
Předmět: [fpc-pascal] why the 0.5 in the Unix Epoch (for UnixToDateTime 
function)


I just noticed that the definition of the constants have 0.5 in it.
Why?


from dateh.inc
const
   JulianEpoch = TDateTime(-2415018.5);

   UnixEpoch = JulianEpoch + TDateTime(2440587.5);


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

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

Re: [fpc-pascal] why the 0.5 in the Unix Epoch (for UnixToDateTime function)

2017-08-01 Thread Vojtěch Čihák

Hi,
 
wiki https://en.wikipedia.org/wiki/Julian_day says that "... Julian day number 0 
assigned to the day starting at noon on January 1, 4713 BC, ..."
The noon means 0,5.
 
V.
__

Od: Dennis 
Komu: FPC-Pascal users discussions 
Datum: 01.08.2017 13:14
Předmět: [fpc-pascal] why the 0.5 in the Unix Epoch (for UnixToDateTime 
function)


I just noticed that the definition of the constants have 0.5 in it.
Why?


from dateh.inc
const
   JulianEpoch = TDateTime(-2415018.5);

   UnixEpoch = JulianEpoch + TDateTime(2440587.5);


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

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