Hi,
May I know what is the script syntax for checking “Subscription out of range”. I tried using, for example, IsNull(Invoice(q)) where q is the counter but it’s not successful. Can anyone advise me on this? Thanks
Kenny
Hi,
May I know what is the script syntax for checking “Subscription out of range”. I tried using, for example, IsNull(Invoice(q)) where q is the counter but it’s not successful. Can anyone advise me on this? Thanks
Kenny
Subject: Command for Checking Subscription Out of Range
If q<0 or q>UBound(Invoice) Then ’ it’s out of range
Subject: Command for Checking Subscription Out of Range
Sounds like you should fix your loop if you’re getting subscript out of range. Can you post some of the code so we can have a look what you might be doing wrong…
Subject: RE: Command for Checking Subscription Out of Range
Kenny,
Use ForAll loop in your code. This will resolve your problem.
Kash.
Subject: RE: Command for Checking Subscription Out of Range
Hi Andrew,
Here is my code:
Forall x In key
q=q+1
If key(q)<> "" Then
'Get the view and create the memo
Set memo = db.CreateDocument
Dim object As NotesEmbeddedObject
memo.Form = "AS400"
memo.IssuanceDate=GDate(Today())
memo.collation = "Yes"
memo.PartNo=partR
If Invoice(q)="" Then
Else
memo.InvoiceNo= Invoice(q)
End If
End Forall
I want to check if Invoice(q) is null, then just come out of the If statement.
Thanks ahead
Subject: RE: Command for Checking Subscription Out of Range
Instead of Invioce(q), use x. As you are storing the values in x thru ForAll statement.
Regards,
Kash.
Subject: RE: Command for Checking Subscription Out of Range
Oh I see. Use this:
If Not Isempty(q) Then
memo.InvoiceNo= Invoice(q)
End If
Subject: RE: Command for Checking Subscription Out of Range
Well… I must admit that I am at a loss here:
First: You create a “memo” document within the loop, and don’t save it. What you will have at the end of the loop will be the reference to the last memo object and quite a lot of garbage to be collected.
→ You have to call save to save that memo you just created.
Secondly: If you have a ordered array (key), why not use “For i=1 to Len(key)” instead of ForAll?
This way you can get rid of that “q”.
I might be mistaken, and you might take care of all these issues somewhere else in your code, but you might want to copy a larger portion of your code here so that we could see how the variables are defined, and try to figure out really just what is the problem with that code.