Jump to content
Sign in to follow this  
jscooper

Strange Results with TexttoNum (FM 6)

Recommended Posts

This is weird:

Create a text field, call it FieldA.

Create a calculation (number) call it Calc set it = texttonum(FieldA) -- just for kicks, set it to always calculate

Now,

Enter "A" into the fieldA, calc is blank

Enter "F" into fieldA, calc is 0

Enter "T" or "Y" into fieldA, calc is 1

I ran across this while testing for numbers in a string (if the string contains a numeric value, run scriptA, if not, run scriptB, etc etc ...) Anyway, I was getting strange behavior while testing since I had fieldA set to "test".

Couldn't find it listed as a bug anywhere, not sure what the deal is. Just thought it strange.

Jeff

Share this post


Link to post
Share on other sites

True, False, T, F, Yes, No, etc. converts to 0 and 1 in versions prior to 7. The usual trick is to use something like TextToNum( "a" & field ) to avoid this issue.

Share this post


Link to post
Share on other sites

And these results are also sensitive to the version you're using.

The french version would for ex. have a 1 for O, "Oui", V, "Vrai" and a 0 for F, "Faux", N, "Non"

I'd assume each language would have its own translation and shortcuts as well, so be careful to how far your solution can be distributed...

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.