FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour For Each Syntax Like VBScript
Posts: 4
Joined: Mon Aug 27, 2012 01:34 AM
For Each Syntax Like VBScript
Posted: Wed May 29, 2013 11:05 PM

Is there a way to emulate For Each syntax in FiveWin similar to VBScript when using CreateObject?

Posts: 310
Joined: Mon Oct 10, 2005 05:10 AM
Re: For Each Syntax Like VBScript
Posted: Thu May 30, 2013 12:29 AM
Antonio helped me with this a while ago - hope it helps

Code (fw): Select all Collapse
for each oItem In oCMSFolder:Items
   nItem++
   dMail    := oItem:ReceivedTime
   cSender  := oItem:sendername
   cSubject := oItem:subject
   cBody    := oItem:body
   for each oAttach In oItem:Attachments
      cAttach := oAttach:filename
      aadd(aAttach,{str(nItem,2),cAttach})
   next
   aadd(aData,{str(nItem,2),dtoc(dMail),(left(alltrim(cSender)  + space(30),30)),(left(alltrim(cSubject)  + space(30),30)),cBody})
next


Colin

Continue the discussion