Solved

Checking for text values in a text field

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

707 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

19 Experts available now in Live!

Get 1:1 Help Now