Home > Domino Tips > Developer > Agent > msgbox with all agents and their lastrun property
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

AGENT

msgbox with all agents and their lastrun property


Sieward Bosch
07.08.2002
Rating: -3.33- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Normally you check the LastRun property of an agent by right clicking on the Agent in the designer and accessing the log. When you have to check a lot of agents and their LastRun property, this agent may come in handy. It presents a message box with all agents in de current database ordered alphabetically with their LastRun property.



Code

 Sub Initialize
 Dim session As New notessession
 Dim db As notesdatabase
 Set db=session.Currentdatabase
  
' Declare 
 Redim AgentName(0) As String
 Redim AgentLastRun(0) As String
 Dim Counter As Integer
 Dim Sorted As Integer
 Dim S1, S2 As String 
 Dim First_string As String
 Dim Second_string As String
 Dim Out As String
 Dim i As Integer
 
' Initialize 
 Counter = 0 
 Sorted = False 
 S1=""
 S2="" 
 First_string=""
 Second_string=""
 Out="" 
 
 Forall agent In db.agents
  AgentName(Counter) = agent.Name
  AgentLastRun(Counter) = Cstr(agent.Lastrun)
  Counter = Counter +1
  Redim Preserve AgentName(Counter+1) As String
  Redim Preserve AgentLastRun(Counter+1) As String
 End Forall
 
' Start BubbleSort
 Do While (Sorted = False)          
  Sorted = True
  For i = 0 To Counter - 2
   
   S1 = AgentName(i)
   S2 = AgentName(i+1)
   If(Strcomp(s1, s2, 5) = 1) Then
    First_string = AgentName(i)
    Second_string = AgentLastRun(i)
    AgentName(i) = AgentName(i+1)
    AgentLastRun(i) = AgentLastRun(i+1)
    AgentName(i+1) = First_string
    AgentLastRun(i+1) = Second_string
    Sorted = False
   End If
  Next
 Loop
' End BubbleSort
 
 For i = 0 To Counter-1
  ' a futile attemp to align the output :-)
  Out = Out + Left((AgentName(i) + ".................................................."),50) & AgentLastRun(i) & Chr(10)
 Next
 
 Messagebox Out
 
End Sub

Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Agent
Quickly scan all databases on a Lotus Domino server
Run or restart Notes/Domino agents via text messages
Approve Lotus Notes documents using a BlackBerry mobile device
LotusScript agent indexes Lotus Notes/Domino databases
Open documents in Lotus Notes from the Web without a UNID
Fix and update Lotus Notes documents with limited access
Verify scheduled agent status with Domino Extensible Language (DXL)
How to export data from a Lotus Notes database to a CSV file
Enable or disable scheduled agents without opening the Lotus Notes database design
Creating custom views in Lotus Notes databases

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts