GpStuff 17.slon
Delphi  
requires:
Version 1.31
   
used in:
2012-01-23
 
Various stuff: Trinary operator, clone-on-assignment functions and more.

Five overloaded functions (all named IFF) that allow for simple conditional expression evaluation but don't offer full functionality of the ?: operator.

Although IFF can be used in expressions like a := IFF(b > 0, 2*b, b div 2), it has the deficiency of all its parameters being evaluated every time. That makes it impossible to use IFF when one of the parameters cannot be evaluated like in a := IFF(b <> 0, 1/b, 0) (in that case because 1/b is evaluated even when b is zero).

Also contains four overloaded Asgn functions that clone an input parameter to output parameter and function result.

Plus more - read the source.

Released under the BSD License.

Files

Last modifications

1.31: 2012-01-23

  • Implemented procedure DontOptimize. Call DontOptimize(x) if you want to prevent compiler from optimizing out the variable x.
  • Implemented IGpAutoDestroyObject.
  • Implemented IGpTraceable.LogReferences.
  • X64 compatible.
  • [GJ] Assembler implementation of the x64 implementation of the TableFind* functions.
  • Added TGpMemoryBuffer - preallocated, growable caching memory buffer for one specific memory size.
  • Implemented EnumFiles enumerator.

1.25: 2010-12-15

  •  Asgn overload taking Ansi/Wide strings.
  • Implemented function DebugBreak.
  • Implemented function DisableHandler.
    Usage:
      with DisableHandler(@@cbDisableInterface.OnClick) do begin
        cbDisableInterface.Checked := newValue;
        Restore;
      end;
  • Added IFF overload with AnsiString parameters (Unicode Delphi only).
 
Last update: 2012-01-28
Google
Search:WWW17slon.com17slon.net