Monday, Oct 14 Week 42

Page 1 of 1  
Showing no. 1 to 2 of 2 items

Simple and reliable thread-based timers for Delphi. The TBpmTimer has one single event for timer impulse, and the TTempoTimer has two events, also one for impulse off. Both timers has a bpm-parameter for built in conversion between milli-seconds and beats per minute. The TBpmTimer thread sleeps a given amount of time "mSecs" while the TTempoTimer thread sleeps one millisecond, and then counts when to synchronize the on and off events... Each kind of timer has its own thread descendant. Borland Delphi 5

Delphi: Safe destruction of objects, threads and memory. Safe means checking that reference is not nil,- also clearing reference before destroying objects. Try..except used to avoid visual exception. Based on FreeAndNil procedure from SysUtils unit. Examples for objects, threads and allocated memory (pointers). procedure safeDispose(var p); procedure safeFree(var obj); procedure safeTerminate(var thrd); implementation procedure safeDispose(var p); var q:pointer;//clear reference before dispose data begin