Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 652
  • Last Modified:

LotusScript question (simple)

Hi experts,

I want to get a value from a picklist using LotusScript, using uiws.PickListStrings(etc etc). This is working fine, but there is also a cancel button using the picklist and I want to check if the cancel is pushed and then exit the code.

This is not working:

choice = uiws.PickListStrings(3,False,"domino1","dbase-algemeen\p&o-idee.nsf","(AlleInzendingen)","Selecteer het ideenummer",_
     "Selecteer hier het ideenummer waaraan dit document toegevoegd dient te worden",1)
     
     If choice(0) = "" Then
          Exit Sub
     End If

What do I need to do to check the cancel button and exit when pushed ?

Greetings,

Bob
0
oosterbaan
Asked:
oosterbaan
1 Solution
 
scottrmaCommented:
From the Designer Help:

PickListStrings

This method returns a Variant containing a stringArray if you click OK, or it could return Nothing if you click Cancel.

So check like this:

If choice Is Nothing Then
       Exit Sub
End If

Regards,

Scott
0
 
cowarishCommented:
If Isempty(choice) Then
End
End If
0
 
ZvonkoSystems architectCommented:
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
oosterbaanAuthor Commented:
Thanks cowarish,

Your version is working (-:

If choice Is Nothing Then
    Exit Sub
End If

is generating a error message...Sorry !!

Greetings,

Bob
0
 
scottrmaCommented:
Hmm, interesting, perhaps the Designer Help in R5 is wrong....wouldn't be the first time it has happened. Also, did you notice how it said:

or it "could" return Nothing if you click Cancel

What's up with the "could"? They (Lotus) sound like they're not sure what could happen :-)

Cheers,

Scott
0
 
oosterbaanAuthor Commented:
Hi Scott,

When using it like that, it's returning a error message:

"Type mismatch"

I'm having the same problem right now with something like this, only with a NotesItem. I have solved it already with a workaround, but I'm not satisfied.

I'm want to access a notesitem on a document, but in some cases the item is not there, so the item is not set...

Set item = doc.GetFirstItem("FieldName")
 If item Is Nothing Then
      item.IsReaders = False
 End If

This is also not working.... Hmmmmm

Greetings,

Bob

0
 
scottrmaCommented:
Well, that one isn't working because if item is Nothing, then you can't access any of item's properties or methods, such as its IsReaders property. Should probably be:

If Not (item Is Nothing) Then
     item.IsReaders = False
End If

Regards,

Scott
0
 
oosterbaanAuthor Commented:
Thanks Scott for your response...

I'll will try this !!!

Greetings,

Bob
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now