>set procedure to .\prog\pingevents >?TestPingEvents() >>
>function TestPingEvents() > > local aa[4], obj, testers[4], i > aa[1] = 'www.microsoft.com' > aa[2] = 'www.jdsjldkjdld.com' > aa[3] = '192.168.0.2' > aa[4] = 'www.altavista.com' > > obj = createobject('ShowPingEvents') > for i = 1 to alen(aa) > > testers[m.i] = createObject(PINGEVENTS_CLASS) > =bindevent(testers[m.i], 'PingResult', m.obj, 'ShowResult', 1) > =testers[m.i].Ping(aa[m.i], 8) > endfor > suspend && let all terminate > >endfunc >*_______________________________________________________________________________ > > > >*_______________________________________________________________________________ >define class ShowPingEvents as relation > >*_______________________________________________________________________________ >function ShowResult( success, ipOrHostname) > > ?m.success, m.ipOrHostname >endfunc >*_______________________________________________________________________________ >protected function Destroy() > > return DoDefault() > >endfunc >*_______________________________________________________________________________ >enddefine >