 




<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Stuck on an IF statement in Lotus Domino</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/stuck-on-an-if-statement/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/stuck-on-an-if-statement/</link>
	<description></description>
	<lastBuildDate>Tue, 21 May 2013 07:47:26 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: amcauley3</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/stuck-on-an-if-statement/#comment-88792</link>
		<dc:creator>amcauley3</dc:creator>
		<pubDate>Mon, 28 Feb 2011 20:36:46 +0000</pubDate>
		<guid isPermaLink="false">#comment-88792</guid>
		<description><![CDATA[AGENT MORE Spaced OUT


Sub Initialize %REM  REFRESH OSHA INFO  Update ALL OSHA Numbers in Current Agenda Headers %END REM 
 Const  LOGNAME = &quot;RefreshOshaInfo&quot;    
REM Notes Handles  
Dim ss As New NotesSession  
Dim db As NotesDatabase  
Dim vw As NotesView  
Dim vc As NotesViewEntryCollection  
Dim vcEntry As NotesViewEntry  
Dim doc As NotesDocument REM 
Dim DC As NotesDocumentCollection 
 Dim RRembview As NotesView  
Dim item As Variant  
Dim strfield As String 
 Dim temp As Variant  
Dim Count As Integer  
Dim agendaloc As Integer  
Dim agyear As Integer  
Dim agmonth As Integer 
 Dim locv As NotesView   
 Dim Headerdoc As NotesDocument 

 Dim workcount As Integer  
REM Other  
Dim nTotalNeededUpdate As Integer 
 Dim nTotalProcessed As Integer 
 Dim bUpdate As Boolean  
Dim ErrorMsg As String  
REM Saved Fields  
Dim nLostTimeDays As Integer 
 Dim nNonLostTimeDays As Integer  
Dim nYTDAccidents As Integer  

Dim nYTDDriverAccidents As Integer  
Dim bodyarray As NotesDocument 
 Dim Ekey As Variant 
 Dim adoc As NotesDocument  
Dim cUpdate As Boolean
 REM Dim nActionitems As Integer  
REM Dim agendaitem As String  
Dim ActionItems As Integer  
Dim aview As NotesView 
 Dim workA As Integer 
 Dim ALcount As Boolean 
 Dim doccount As Integer   
 

On Error Goto ProcessError   
 Call AgentLogAction(LOGNAME, &quot;&lt;------Start------&gt;&quot;) 
 Set db = ss.CurrentDatabase      
Set aview = db.GetView(&quot;RREMB&quot;) &#039;added 2/16/2011    
  ErrorMsg=&quot;View CurrHeaders NOT Found&quot;   
 Set vw = db.GetView(&quot;CurrHeaders&quot;)  &#039;All Current Agenda Headers  
Set vc = vw.AllEntries    
ErrorMsg = &quot;View collection NOT Found&quot;    
Set vcEntry = vc.GetFirstEntry    ErrorMsg=&quot;&quot;       
 Do While Not (vcEntry Is Nothing)   
Set doc = vcEntry.Document   
REM AM changes 2/16/2011
   Ekey = doc.Loc(0)&amp; &quot;~&quot; &amp; doc.mtgyy(0) &amp; &quot;~&quot; &amp; doc.mtgmm(0)        
 Set DC= 
aview.GetAllDocumentsByKey(Ekey,True)      

WorkA = dc.count         

THIS IS WHERE I NEED THE Help

If workA = doc.actionitems(0) Then    
alcount =True   
Else    
doc.ActionItems = dc.count      




  REM doc.ActionItems(0) = dc.Count           
 End If      
nTotalProcessed = nTotalProcessed + 1   
 REM Save current values      
nLostTimeDays= doc.LostTimeDays(0)   
nNonLostTimeDays = doc.NonLostTimeDays(0)  
 nYTDAccidents = doc.YTDAccidents(0)   
nYTDDriverAccidents= doc.YTDDriverAccidents(0)  

    REM Update Osha Numbers for this doc  
 Call GetOshaInfo(doc.Loc(0), doc)      
bUpdate = False   
bUpdate = bUpdate Or alcount  
 bUpdate = bUpdate Or ( nLostTimeDays &lt;&gt; doc.LostTimeDays(0) )  
 bUpdate = bUpdate Or ( nNonLostTimeDays &lt;&gt; doc.NonLostTimeDays(0) )   
bUpdate = bUpdate Or ( nYTDAccidents &lt;&gt; doc.YTDAccidents(0) )  
 bUpdate = bUpdate Or ( nYTDDriverAccidents &lt;&gt; doc.YTDDriverAccidents(0) ) 
     If bUpdate Then      
Call doc.Save (True,False)     
nTotalNeededUpdate = nTotalNeededUpdate + 1   
End If   Print Right(&quot;00000&quot; + Cstr(nTotalProcessed), 5) &amp; &quot; OSHA Headers processed  -  &quot; + Right(&quot;00000&quot; + Cstr(nTotalNeededUpdate), 5)  &amp; &quot; OSHA Headers needed updates.&quot;   Set vcEntry = vc.GetNextEntry(vcEntry)  Loop     Finish:  Call AgentLogAction(LOGNAME, Right(&quot;00000&quot; + Cstr(nTotalProcessed), 5) &amp; &quot; OSHA Headers processed.&quot;)  Call AgentLogAction(LOGNAME, Right(&quot;00000&quot; + Cstr(nTotalNeededUpdate), 5)  &amp; &quot; OSHA Headers needed updates.&quot;)  Call AgentLogAction(LOGNAME, &quot;&lt;------End-------&gt;&quot;)  Exit Sub   ProcessError:  Stop  Call AgentLogError(LOGNAME,0,  &quot;Line: &quot; &amp; Erl() &amp;  &quot;Error:&quot; &amp; Err() &amp; &quot;=&quot; &amp; Error() )  Resume POExit POExit: End Sub]]></description>
		<content:encoded><![CDATA[<p>AGENT MORE Spaced OUT</p>
<p>Sub Initialize %REM  REFRESH OSHA INFO  Update ALL OSHA Numbers in Current Agenda Headers %END REM<br />
 Const  LOGNAME = &#8220;RefreshOshaInfo&#8221;<br />
REM Notes Handles<br />
Dim ss As New NotesSession<br />
Dim db As NotesDatabase<br />
Dim vw As NotesView<br />
Dim vc As NotesViewEntryCollection<br />
Dim vcEntry As NotesViewEntry<br />
Dim doc As NotesDocument REM<br />
Dim DC As NotesDocumentCollection<br />
 Dim RRembview As NotesView<br />
Dim item As Variant<br />
Dim strfield As String<br />
 Dim temp As Variant<br />
Dim Count As Integer<br />
Dim agendaloc As Integer<br />
Dim agyear As Integer<br />
Dim agmonth As Integer<br />
 Dim locv As NotesView<br />
 Dim Headerdoc As NotesDocument </p>
<p> Dim workcount As Integer<br />
REM Other<br />
Dim nTotalNeededUpdate As Integer<br />
 Dim nTotalProcessed As Integer<br />
 Dim bUpdate As Boolean<br />
Dim ErrorMsg As String<br />
REM Saved Fields<br />
Dim nLostTimeDays As Integer<br />
 Dim nNonLostTimeDays As Integer<br />
Dim nYTDAccidents As Integer  </p>
<p>Dim nYTDDriverAccidents As Integer<br />
Dim bodyarray As NotesDocument<br />
 Dim Ekey As Variant<br />
 Dim adoc As NotesDocument<br />
Dim cUpdate As Boolean<br />
 REM Dim nActionitems As Integer<br />
REM Dim agendaitem As String<br />
Dim ActionItems As Integer<br />
Dim aview As NotesView<br />
 Dim workA As Integer<br />
 Dim ALcount As Boolean<br />
 Dim doccount As Integer   </p>
<p>On Error Goto ProcessError<br />
 Call AgentLogAction(LOGNAME, &#8220;&lt;&#8212;&#8212;Start&#8212;&#8212;&gt;&#8221;)<br />
 Set db = ss.CurrentDatabase<br />
Set aview = db.GetView(&#8220;RREMB&#8221;) &#8216;added 2/16/2011<br />
  ErrorMsg=&#8221;View CurrHeaders NOT Found&#8221;<br />
 Set vw = db.GetView(&#8220;CurrHeaders&#8221;)  &#8216;All Current Agenda Headers<br />
Set vc = vw.AllEntries<br />
ErrorMsg = &#8220;View collection NOT Found&#8221;<br />
Set vcEntry = vc.GetFirstEntry    ErrorMsg=&#8221;"<br />
 Do While Not (vcEntry Is Nothing)<br />
Set doc = vcEntry.Document<br />
REM AM changes 2/16/2011<br />
   Ekey = doc.Loc(0)&amp; &#8220;~&#8221; &amp; doc.mtgyy(0) &amp; &#8220;~&#8221; &amp; doc.mtgmm(0)<br />
 Set DC=<br />
aview.GetAllDocumentsByKey(Ekey,True)      </p>
<p>WorkA = dc.count         </p>
<p>THIS IS WHERE I NEED THE Help</p>
<p>If workA = doc.actionitems(0) Then<br />
alcount =True<br />
Else<br />
doc.ActionItems = dc.count      </p>
<p>  REM doc.ActionItems(0) = dc.Count<br />
 End If<br />
nTotalProcessed = nTotalProcessed + 1<br />
 REM Save current values<br />
nLostTimeDays= doc.LostTimeDays(0)<br />
nNonLostTimeDays = doc.NonLostTimeDays(0)<br />
 nYTDAccidents = doc.YTDAccidents(0)<br />
nYTDDriverAccidents= doc.YTDDriverAccidents(0)  </p>
<p>    REM Update Osha Numbers for this doc<br />
 Call GetOshaInfo(doc.Loc(0), doc)<br />
bUpdate = False<br />
bUpdate = bUpdate Or alcount<br />
 bUpdate = bUpdate Or ( nLostTimeDays &lt;&gt; doc.LostTimeDays(0) )<br />
 bUpdate = bUpdate Or ( nNonLostTimeDays &lt;&gt; doc.NonLostTimeDays(0) )<br />
bUpdate = bUpdate Or ( nYTDAccidents &lt;&gt; doc.YTDAccidents(0) )<br />
 bUpdate = bUpdate Or ( nYTDDriverAccidents &lt;&gt; doc.YTDDriverAccidents(0) )<br />
     If bUpdate Then<br />
Call doc.Save (True,False)<br />
nTotalNeededUpdate = nTotalNeededUpdate + 1<br />
End If   Print Right(&#8220;00000&#8243; + Cstr(nTotalProcessed), 5) &amp; &#8221; OSHA Headers processed  &#8211;  &#8221; + Right(&#8220;00000&#8243; + Cstr(nTotalNeededUpdate), 5)  &amp; &#8221; OSHA Headers needed updates.&#8221;   Set vcEntry = vc.GetNextEntry(vcEntry)  Loop     Finish:  Call AgentLogAction(LOGNAME, Right(&#8220;00000&#8243; + Cstr(nTotalProcessed), 5) &amp; &#8221; OSHA Headers processed.&#8221;)  Call AgentLogAction(LOGNAME, Right(&#8220;00000&#8243; + Cstr(nTotalNeededUpdate), 5)  &amp; &#8221; OSHA Headers needed updates.&#8221;)  Call AgentLogAction(LOGNAME, &#8220;&lt;&#8212;&#8212;End&#8212;&#8212;-&gt;&#8221;)  Exit Sub   ProcessError:  Stop  Call AgentLogError(LOGNAME,0,  &#8220;Line: &#8221; &amp; Erl() &amp;  &#8220;Error:&#8221; &amp; Err() &amp; &#8220;=&#8221; &amp; Error() )  Resume POExit POExit: End Sub</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 6/8 queries in 0.012 seconds using memcached
Object Caching 269/270 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-21 08:29:22 -->