We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

lotus script - pulling an item directly into an array

BillTr
BillTr asked
on
Medium Priority
359 Views
Last Modified: 2013-12-18
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
Comment
Watch Question

Groupware Consultant
CERTIFIED EXPERT
Commented:
>> 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).

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Is there a way to get the last position (or last value) in the array/variant without looping through and counting them?


Sjef BosmanGroupware Consultant
CERTIFIED EXPERT

Commented:
For i= 0 To Ubound(array)

Author

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


Sjef BosmanGroupware Consultant
CERTIFIED EXPERT

Commented:
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...)

Author

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!!!!
Sjef BosmanGroupware Consultant
CERTIFIED EXPERT

Commented:
No problem, don't worry. Next time better!
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.