DeHL 0.8.1

DeHL

I’ve just released the version 0.8.1 of DeHL. The downloads can be found on this page and changelog on this page.

This is mostly a fix release with only one major feature – Cloning (in DeHL.Cloning). The rest of the changes are either bug fixes or janitorial changes.

Have Fun!

10 Responses to 'DeHL 0.8.1'

  1. Andrew Tierney says:

    Any chance of adding a String type similar to .NET using records/operator overloads etc ?

    It would be nice to be able to do something like:

    var myString: DString;

    myString.Length();
    myString.Trim().ToUpper();
    myString.SubString(3,4);
    myString + ‘ more text ‘ + 123 + ‘.';
    myString.Format(“Something here {0} “,myString2);
    (Parse/ToString/TryParse/etc etc etc etc)

    Basically cloning .NET String class. (like you’ve done for DateTime)

    It would make it easier for C# guys to move to delphi, instead of switching to Pos(), etc etc..

    Just a thought..

    Andrew

  2. alex says:

    I actually have a semi-working version of “TString” but I never go the time finish it properly.

  3. Bo Sorensen says:

    There is a bug in DeHL.Arrays, i created a bug report for it at http://code.google.com/p/delphilhlplib/issues/detail?id=14

  4. alex says:

    Checked in a fix. Thank you!

  5. Andrew Tierney says:

    Any chance of releasing the code ? (in or out of DeHL ?)

    I’m sure someone :-) Would be happy to assist in finishing the “TString” code.

  6. alex says:

    Somewhere next week I hope to have something worthwhile.

  7. Looking forward to seeing ‘something worthwhile’….

    Will it be part of DeHL ? (hope so..)

  8. alex says:

    Here you go:
    http://code.google.com/p/delphilhlplib/source/browse/trunk/Library/src/Extensions/DeHL.Strings.pas

    Still need to iron some things out and to start writing tests after the public API is complete.

    If you have any suggestions feel free to email me.

    P.S. Need a better name. TString sounds weird!

  9. Nice..

    Couple of suggestions….

    Format() *** BUT USING .NET style params instead of SysUtils/Delphi style ***

    {0:C} for currency
    {0:D} for Decimal
    {0:0000.00} would pad 43.1 as 0043.10
    {0:X} for Hex
    {0,-10:0.0} would pad 123.4567 as “123.5 ”

    etc

    JclStrings has an method called… DotNetFormat() not sure if its a true clone of Format in .NET. Again.. .NET guys can translate easier to Delphi if the Format matches the .NET style.

    Missing from .NET in the DeHL String.pas are:

    Equals(String), IsNullOrEmpty, IsNullOrWhiteSpace, ToCharArray, TrimEnd,
    TrimStart() – I see TrimLeft etc.. So maybe an alias for TrimStart/TrimLeft.

    Maybe add some common extension methods ??

    ie.

    Mid()
    Left()
    Right()
    Reverse()

    For old Basic style programmers..

    And maybe ToBase64, IsNumeric, IsDate, IsAlpha ?

    Delphi2011 will be getting RegEx from what I understand so the IsXYZ methods could be record helpers in a StringExt file ???

  10. alex says:

    Added most things in. Some .NET methods make no sense in Delphi, for example String.IsNullOrEmpty. Nil and Empty strings are same on Delphi. I’ve marked those as deprecated by default and those are only compilable by a switch (on by default).

    Format is a bit tougher! There are many things there that needs implementing. will leave it for some other time when I do have it.

    Note: DeHL is not a .NET porting helper. There are decisions that I make that might not be .NET friendly.

    Alex.

Leave a Reply

Your email address will not be published.