Icons, we need more icons!

March 2nd, 2008

I can write programs, play a little with Photoshop, but when it comes to graphics, man I suck! I’m always looking for cool icons, bitmaps and images to include in my software. It’s an amusing fact of a programmers life that most people barely care if what you write actually works, just so long as it looks good!  I came across the following site recently and I’ve been using some of the images and icons in my new upcoming CPU speed software.

http://www.vistaicons.com/

web_browsers_icons

The icons and other images resources are free and quality is pretty good. Take a look.

graphics

Did you say Indy?!

February 2nd, 2008

Indy version 10. Must hold the title for world’s most unfriendly Delphi/comms help files and documentation! Thanks to Google (and René Laursen from TeamB), I’ve been able to code-up some TCP comms in a few hours which otherwise might have taken a few days. But, thanks Indy! Those components are truly great.

http://www.indyproject.org/

Delphi ,

Sample function for reading XML node value

January 2nd, 2008

I’ve had many problems using the IXMLDocument object, mostly related to different versions of the .net redistributable installed on different machines. So, I wrote a short function that extracts a node value from the passed XML string:

function GetNodeVal(sNode, sXML : string) : string ;
{This function extracts the specified xml node's value from the XML string}

var
  iPos : integer ;
  sValue : string ;

begin
  iPos := Pos('<'+ sNode + '>', sXML) ;

  if iPos = 0 then
  begin
    iPos := Pos('<'+ Lowercase(sNode) + '>', sXML) ;

    if iPos = 0 then
    begin
      result := 'Error:Globals.GetNodeVal' ;
      exit ;
    end;
  end;

  sValue := Copy(sXML, iPos + 2 + Length(sNode), 255) ;

  iPos := Pos('</' + sNode + '>', sValue) ;

  if iPos = 0 then
  begin
    iPos := Pos('</'+ Lowercase(sNode) + '>', sValue) ;

    if iPos = 0 then
    begin
      result := 'Error:Globals.GetNodeVal' ;
      exit ;
    end;
  end;

  sValue := Copy(sValue, 1, iPos -1) ;
  result := sValue ;
end;

Delphi