Solved

Checking for text values in a text field

Posted on 2003-10-27
3
196 Views
Last Modified: 2013-12-18

Bit of a dodgy explanation so sorry about that.

I have an agent which loops through all unprocessed documents.  It looks for a text field (called equipment code) and if the value contains a number only I use CInt so that I can determine what the numeric value is and then set various flags on the document.

The problem is if the text field contains non numeric values a type mismatch error will be generated and the agent fails.

So I want to be able to check for non numeric values. If text is found then I do not do the CInt and move to the next document.  Otherwise I do the CInt and continue with the rest of the agent.

Surely can't be that hard!?
Thanks.
Stuart
0
Comment
Question by:StuartCalam
  • 2
3 Comments
 
LVL 31

Accepted Solution

by:
qwaletee earned 80 total points
ID: 9631834
Instead of:

set doc = xyzyz.getFirstDocument
Do until doc is nothing
  fieldValue = doc.someValue(0)
  intValue = cint(fieldValue)
  set doc = xyzyz.getNextDocument(doc)
loop



Use this:

set doc = xyzyz.getFirstDocument
Do until doc is nothing
  fieldValue = doc.someValue(0)
  if isNumeric(fieldValue) then 'new line!!! 1 of 2
    intValue = cint(fieldValue)
  end if 'new line!!!! 2 of 2
  set doc = xyzyz.getNextDocument(doc)
loop

0
 

Author Comment

by:StuartCalam
ID: 9631864
Well, that was easy!
Thanks.
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9631879
sure
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now