unit Statedd; (* Author: Rob Martin, rob@robmart.com This component spits out the list of states in the US. *) interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, UpdateOk, tpAction, WebTypes, WebIniFL, WebLink, WebDrop, Ucstring, Wdbsorce , WebDBDrp; type TWebStateDropdown = class(TWebDataAwareDropDown) private { Private declarations } protected { Protected declarations } function DoUpdate:Boolean;override; public { Public declarations } // procedure SendstateListbox(const aName: String); published { Published declarations } end; Const cTheStates = 'AK,AL,AZ,AR,CA,CO,CT,DE,DC,FL,GA,GU,HI,ID,IL,IN,IA,KS,KY,LA,ME' + ',MD,MA,MI,MN,MS,MO,MT,NE,NV,NH,NJ,NM,NY,NC,ND,OH,OK,OR,PA,PR,RI,SC' + ',SD,TN,TX,UT,VT,VA,VI,WA,WV,WI,WY'; procedure Register; implementation function TWebStateDropDown.DoUpdate:Boolean; var a1, a2 : string; begin result := inherited DoUpdate; if not result then exit; list.clear; a1 := cTheStates; While a1 <>'' do begin Splitstring(a1,',',a2,a1); list.add(a2 + '=' + a2); end; end; procedure Register; begin RegisterComponents('robpack', [TWebStateDropdown]); end; end.