| Author |
Message |
seenivasakan Currently Banned New User
Joined: 13 May 2007 Posts: 21 Location: Karnataka
|
|
|
|
Greetings.
I have a small requirement to find whether any line has any numercial values. if anyone knows any function or any other method to find this, please share it with me
Regards |
|
| Back to top |
|
 |
References
|
Posted: Thu Mar 27, 2008 2:39 pm Post subject: Re: how to find whether the line has any numbers? |
 |
|
|
 |
enrico-sorichetti
Global Moderator
Joined: 14 Mar 2007 Posts: 1788 Location: italy
|
|
|
|
| verify(string,"0123456789","M") |
|
| Back to top |
|
 |
Marso
Active User
Joined: 13 Mar 2006 Posts: 264 Location: Israel
|
|
|
|
or:
| Code: |
If DataType(myvar,'W') = 0 Then
Say 'It''s a whole number!'
Else
Say 'That''s not a number!' |
Use 'N' instead of 'W' if you want to accept any number |
|
| Back to top |
|
 |
acevedo
Active User
Joined: 11 May 2005 Posts: 246 Location: Spain
|
|
|
|
| if I'm not wrong the question is not if the string is numeric or not BUT if the string contains any numercial values... that's the difference between enrico and Marso answers... |
|
| Back to top |
|
 |
seenivasakan Currently Banned New User
Joined: 13 May 2007 Posts: 21 Location: Karnataka
|
|
|
|
Actually my code is like below.
2 WST-EDIT-ADDL-BTCH-HEDR REDEFINES WST-BANK-TAPE-HEADER
2 WST-EDIT-ADDL-BTCH-HEDR GROUP 68 1 80 80
3 WST-EABH-ADDL-BTCH-RCRD-CD
XX 69 1 2 2
The first and third line does not have any numeric where as the second line has numbers. i want to find the first and third line?.
Any suggestions on any functions? |
|
| Back to top |
|
 |
enrico-sorichetti
Global Moderator
Joined: 14 Mar 2007 Posts: 1788 Location: italy
|
|
|
|
| You already got them |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 5929 Location: 221 B Baker St
|
|
|
|
Hello,
| Quote: |
| The first and third line does not have any numeric where as the second line has numbers. i want to find the first and third line?. |
I see some number(s) in all 4 lines Why are the leading digits on the first 3 lines and the set of numbers in the 'xx' line not "numeric"?
What if a field was "WST-BANK-TAPE3-HEADER"? Is the 3 numeric?
Until you provide a more complete definition (if only for yourself), the implementation will be questionable at best. |
|
| Back to top |
|
 |
Marso
Active User
Joined: 13 Mar 2006 Posts: 264 Location: Israel
|
|
|
|
| dick scherrer wrote: |
| What if a field was "WST-BANK-TAPE3-HEADER"? Is the 3 numeric? |
Exactly. If the meaningful numbers are always on the right side of the string, the logic will be completely different.
Why do we have always to beg for information? (just thinking aloud) |
|
| Back to top |
|
 |
|
|