Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Checking for text values in a text field

Posted on 2003-10-27
3
Medium Priority
?
202 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

618 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