?
Solved

Checking for text values in a text field

Posted on 2003-10-27
3
Medium Priority
?
205 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 320 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

Technology Partners: 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!

Question has a verified solution.

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

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
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…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

829 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