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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.