var
r : OleVariant; // range
c : OleVariant; // cell
Enum : TEnumVariant;
begin
Enum := TEnumVariant.Create(r);
while(Enum.ForEach(c)) do begin
....do something with c...
end;
end;
Some minor edits are needed for Delphi 2007.
I am a full-time consultant and provide services related to the design, implementation and deployment of mathematical programming, optimization and data-science applications. I also teach courses and workshops. Usually I cannot blog about projects I am doing, but there are many technical notes I'd like to share. Not in the least so I have an easy way to search and find them again myself. You can reach me at erwin@amsterdamoptimization.com.
Monday, June 16, 2008
Delphi foreach (COM) implementation
Comlib (http://www.techvanguards.com/com/resources/downloads.asp) has an implementation of the foreach construct (used in COM Automation). Example:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment