Wait for activity to finish before next FOR loop

Martin Obongita martin.obongita at yahoo.com
Fri Jul 22 17:10:11 UTC 2022

Hi $Listers,
I have a FOR loop that runs through a list and sends emails.The problem I have is that the next line in the list is loaded and sent before the previous line has finished emaling.Therefore the email process is cancelled.
I'm short of wits on how I could delay or check for a flag to indicate that the process has finished before the next FOR loop begins.
Calculate iFileListLineCount as lFileList.$linecount

For iFileListLineNum from 1 to iFileListLineCount step 1

Calculate iToReceiver as lFileList.[iFileListLineNum].email

Calculate iPath as lFileList.[iFileListLineNum].FilePath

Calculate iFilename as lFileList.[iFileListLineNum].name

Do $cwind.$setFileListInfoRow(iToReceiver,iPath,iFilename)

Do $cinst.$start

End For

As you can see from this method, the next FOR loop will run before the DO $cinst.$start is complete.
I have read the documentation and I'm not sure if I could use Object Reference.Has anyone used ObjRef in this case or there is a cleaner code that can solve this?
Kind regards,Martin O.

More information about the omnisdev-en mailing list