billem Posted February 22, 2005 Posted February 22, 2005 I have a string in foot and inches, 2'-2 1/2", and want to use the position function to return the location of the ' character. I get zero and not 2. Why?
Vaughan Posted February 22, 2005 Posted February 22, 2005 Post the exact function you are using. Is the field's data type set to text or number? It needs to be text for this to work.
billem Posted February 22, 2005 Author Posted February 22, 2005 It is set to text. I've even tried changing the string to something like "this' is a test". still get 0
billem Posted February 22, 2005 Author Posted February 22, 2005 i am using a text field. I've even changed the string to something like " this ' is a test" and still get 0 returned
billem Posted February 22, 2005 Author Posted February 22, 2005 i know that i am using the postion function correctly because if ask it to return the position of "a" in "this ' is a test", i get 11
RalphL Posted February 22, 2005 Posted February 22, 2005 Turn off smart quotes and re-enter the " & '.
billem Posted February 22, 2005 Author Posted February 22, 2005 are you suggesting this: Position ( size; "&'"; 1 ; 1 ), which I just tried and got 0
RalphL Posted February 22, 2005 Posted February 22, 2005 No, I am saying you must go to the File menu and select File Options, then Text and then unckeck the box that says "Use smart quotes" Now every place you used a " or a ' retype it. Your calculation should be Position ( String ; "'" ; 1 ; 1 ).
Vaughan Posted February 22, 2005 Posted February 22, 2005 Well spotted Raplh. I gues you couls keep smart quotes as well by also looking for curly quotes as well as straight ones.
Recommended Posts
This topic is 7215 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now