The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,423 other followers

Damned ! var Comp : function(const s1, s2: string): Boolean; begin if CheckB…

Posted by jpluimers on 2018/01/10

One of my main gripes about lots of RTL/VCL/FMX code: conventions are often lacking.

Which means one of the below functions starts with Ansi (but does a Unicode operation) and the other has the parameters in reverse.

var 
  Comp: function(const s1, s2: string): Boolean;
  begin 
    if CheckBox1.Checked then 
      Comp := ContainsText 
    else 
      Comp := AnsiStartsText;
  end;

–jeroen

source: [WayBackDamned ! var Comp : function(const s1, s2: string): Boolean; begin if CheckB… – Paul TOTH +

2 Responses to “Damned ! var Comp : function(const s1, s2: string): Boolean; begin if CheckB…”

  1. rvelthuis said

    These functions are (still) called AnsiXXX for reasons of backward compatibility. They got the Ansi prefix to indicate they use the current locale, i.e. in contrast to plain ASCII.

  2. thaddy said

    comp is a type. hurts my eyes…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
%d bloggers like this: