Solved

Checking for text values in a text field

Posted on 2003-10-27
3
197 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

831 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