lotus script - pulling an item directly into an array

I have an action that pulls data from forms in a view. One of the fields I pull is a list of names. Currently I pull these into a delimited string first then into an array where I sort. This code is duplicated for a couple of other fields. I think I s/b be able to pull directly from the field into the array, since I am pulling it from a notesitem to start with, and speed things up. Assuming I am correct could someone provide an example?

Thanks
BillTrAsked:
Who is Participating?
 
Sjef BosmanConnect With a Mentor Groupware ConsultantCommented:
>> I have an action that pulls data from forms in a view.
Small correction: a view doesn't contain forms, but documents.

Indeed, for the values ARE an array.

Examples:

Dim doc As NotesDocument
Dim v As Variant

v= doc.GetItemValue("YourField")

or

Dim item As NotesItem

Set item= doc.GetFirstItem("YourField)
v= item.Values

In both examples above, v is an array of the values in the item. If there's only a single value, it is in v(0).
0
 
BillTrAuthor Commented:
Is there a way to get the last position (or last value) in the array/variant without looping through and counting them?


0
 
Sjef BosmanGroupware ConsultantCommented:
For i= 0 To Ubound(array)
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
BillTrAuthor Commented:
Isn't this is just another loop?  I was trying to get the count of records in the array without looping.
Not possible?


0
 
Sjef BosmanGroupware ConsultantCommented:
It's the function Ubound(array), but I decided to give you an example (lack of time, very sorry, and now you gave me a B...)
0
 
BillTrAuthor Commented:
I did end up using this and I like it. I tried to up the rating, let me know if it doesn't take.


Thanks!!!!
0
 
Sjef BosmanGroupware ConsultantCommented:
No problem, don't worry. Next time better!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.