Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TEST FOR NUMERIC IN IMPORTED FIELD 1

Status
Not open for further replies.

jware

Programmer
Apr 28, 1999
14
US
I am importing data records created in the COBOL enviroment that has two fields that need to be checked to ensure they contain numeric data. In COBOL we would say IF NUMERIC...
Anyway to do this check in Filemaker?
Thanks,
James
 
I figured out a way to get it done but it is cumbersome.
For anyone who need to know it goes as follows:
Create a calculated field that use NumToText to convert the input number field to a (textfield)
Use Case of If function and the Right function to check
the right most character in the textfield to see if it
contain "0"; if so return 0, if not return 1.
Use the test for numbers 1, 2, 3, 4, 5, 6, 7, 8, 9.
If any of the test return the number 1 then the field
contain other than numeric characters. If not, then the
numeric field can be used for summaries, etc.
James
 
You need to check how the NumToText function works if the original 'number' is invalid. (I'm not sure but I think it will take just about anything.)
What about decimal points?

You might think about a script like this
Set Field WorkT1, "1234567890"
Set Field WorkT2, MyTextNum
loop
if PatternCount(WorkT1, Left(MyTextNum, 1)= 0
[error mesage .... whatever]
else
set field WorkT2, right(WorkT2, length(WorkT2) - 1)
endif
end loop
You need to clean it up to get out of the loop.


Cheers,
Paul J.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top