11.07.2015 Views

Automate Scheduler Using Macros

Automate Scheduler Using Macros

Automate Scheduler Using Macros

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 6: PropertiesResultSet PropertySyntaxCompletedJob.ResultSetApplies ToCompletedJobDescriptionReturns whether the completed task was a remote task.DiscussionThe values of this property are• True - the completed job was a remote task• False - he completed job was a local taskTypeBooleanAccessReadExampleThis example counts the number of remote tasks that exist in the<strong>Scheduler</strong> database, and displays this in a message box.Sub Main()Dim objSchedApp As ObjectDim objCompletedTasks As ObjectDim intCounter As IntegerDim intRemoteTasks As IntegerSet objSchedApp = CreateObject("Cognosbatcher.Application")Set objCompletedTasks = objSchedApp.CompletedintRemoteTasks = 0For intCounter = 1 To objCompletedTasks.Count'check the ResultSet property to determine if the completed'task is a remote task.If objCompletedTasks.Item(intCounter).ResultSet ThenintRemoteTasks = intRemoteTasks + 1End IfNext intCounterMsgBox "There are " &Str(objCompletedTasks.Count - intRemoteTasks) & _" local completed tasks and " & Str(intRemoteTasks) & _" remote completed tasks."Set objCompletedTasks = NothingSet objSchedApp = NothingEnd Sub118 <strong>Automate</strong> <strong>Scheduler</strong> <strong>Using</strong> <strong>Macros</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!