Download Delphi XE2 Foundations - Part 2 by Chris Rolliston PDF

By Chris Rolliston

Half 2 of a complete advisor to the language and middle non-visual libraries of Embarcadero Delphi XE2; during this half, string dealing with, collections and I/O are lined. Adopting an built-in method, the booklet covers either more moderen and older beneficial properties along each other.

Show description

Read or Download Delphi XE2 Foundations - Part 2 PDF

Similar languages & tools books

Foundations of Constraint Satisfaction

This textbook examines the constraint pride challenge (CSP), that's a common challenge in AI functions. It goals to supply a finished advent to the CSP, masking theoretical, useful and implementation concerns. The ebook discusses formal definitions, CSP fixing algorithms and implementation of a few of the algorithms on PROLOG.

Extra resources for Delphi XE2 Foundations - Part 2

Sample text

Asz]*') then ... Under the hood, MatchesMask works by constructing a temporary TMask object. Free; end; Result := True; end; //... RetVal := All4DigitStrings(['7631', '1573', '1630']); //True MatchesMask and TMask limitations Whether you use either MatchesMask or TMask directly, two significant limitations exist: you can’t turn off case insensitivity for ‘ordinary’ letters, and parsing is somewhat ASCII-centric. The second issue means case insensitivity actually disappears if you specify characters outside of the ASCII range.

Individual Char values can also be enumerated using a for/in loop, though this provides only read access: procedure TestForIn; var C: Char; S: string; begin S := 'Hello world'; for C in S do WriteLn(C); end; Returning length information (Length, ByteLength) To return the number of Char values held in a string, call Length. Since this function is both inlined and returns a value stored in the string’s implicit header, it is a very fast. e. 2. Other string types Up until now, I have been talking about ‘the’ string type in Delphi.

Both CompareStr and AnsiCompareStr are case sensitive, so that ‘TEST’ is not considered the same as ‘test’. The case insensitive versions are CompareText and AnsiCompareText. Beyond case insensitivity, their semantics match those of their case sensitive equivalents. Further variants are SameText and AnsiSameText, which are case insensitive like CompareText and AnsiCompareText but return a Boolean instead of an integer. Lastly, if you are comparing file names, SameFileName will handle for you differences between case sensitive and case insensitive file systems, along with idiosyncrasies in (for example) the way OS X stores file names.

Download PDF sample

Rated 4.96 of 5 – based on 15 votes