Q
Problem solve Get help with specific problems with your technologies, process and projects.

Code appears to start at beginning of view

Where am I going wrong here? I have the following code looping through a view. It all runs fine but it appears to start at the beginning of the view and go to what should be the next entry when I call the getnext. The code is as follows and there is an example after it.
Dim NextEntry As NotesViewEntry 
Set CurViewNav = CurView.CreateViewNav
Set CurViewEntry = CurViewNav.getFirst
temp = "&lttr>"
Dim count As Integer
While Not Isnull(CurViewEntry)
 'Set nextEntry = CurViewEntry
 If CurViewEntry.iscategory 
Or CurViewEntry.istotal Then
  For i = 0 To Ubound
(CurViewEntry.ColumnValues)
   temp = Temp + "&lttd>" 
+ CurViewEntry.ColumnValues(i) + "</td>"
  Next i
  Temp = Temp + "&lttr>&ltbr>"
  Print temp
 End If
 Set CurViewEntry = CurViewNav.getNext(CurViewEntry) 
Wend 

If the categories in the view were 1, 2 and 3, the output would look like this:
Category
1
1
2
1
2
3
1
2
3
Total entry

It looks like the problem is that you're not clearing out the contents of the temp variable after each loop iteration. Each time through, the temp variable just keeps getting more data appended to it, instead of starting out fresh for each category.

Simply adding temp = "<TR>" before Wend should do the trick.

Do you have comments on this Ask the Expert question and response? Let us know.

Dig Deeper on Lotus Domino Designer

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close