April 8, 200718 yr Newbies I have been trying to figure out a calculation (for use in a script) that will delete the last character in a text field. I've tried various find/replace with "", and other options, but no luck yet. Replacing/deleting the last character is probably all I would normally need, but replacing/deleting the last character IF that character is "x" would be safer. New to this forum. Skills have gotten kind of rusty with FM. Thanks very much for any tips, pointers to other help files, etc. Ed
April 8, 200718 yr Case( Right ( yourField ; 1 ) = "x" ; Left ( yourField ; Length ( yourField ) - 1 ); yourField )
April 9, 200718 yr Author Newbies Case( Right ( yourField [color:red]) = "x" ; Left ( yourField ; Length ( yourField ) - 1 ; yourField ) Thanks very much! I tried your suggestion above -- but FM highlighted the first "[color:red])" and said there are too few parameters in this function. So I changed that part to be consistent with: Right ( text ; numberOfCharacters ) Then the calc read: Case( Right ( yourField; 1 ) = "x" ; Left ( yourField ; Length ( yourField ) - 1 [color:red]; yourField ) But FM highlighted the "[color:red];" after the -1 and said "There are too many parameters in this function." I've tried a few things. Probably getting close to a solution, but no success yet. Thanks again! Ed
April 9, 200718 yr raybaudi's solution reads: [color:green]Case( Right ( yourField ; 1 ) = "x" ; Left ( yourField ; Length ( yourField ) - 1 ); yourField ) Your first version read: [color:red]Right ( yourField ) = "x" not [color:green]Right ( yourField ; 1 ) = "x" Your second reads: [color:red]Left ( yourField ; Length ( yourField ) - 1 ; instead of: [color:green]Left ( yourField ; Length ( yourField ) - 1 ); ...you missed the bracket off! Just read more carefully or copy and paste it...
April 9, 200718 yr It DOES look like a copy/paste. There is also possibility that Danielle corrected it after it was copied. We correct our posts quite often. :wink2:
April 9, 200718 yr That is a distinct posibility ... but the error does seem to be right next to "yourField" in both places ... which Edv probably would have changed to fit the calc discussed.
April 9, 200718 yr Author Newbies Great! It works! Thanks very much to raybaudi(!) and StuartT and LaRetta. Unless I copied and pasted things wrong this is what works for me... [color:blue]Case( Right ( YourField; 1 ) = "x" ; Left (YourField ; Length ( YourField ) - 1 ); YourField ) Thanks again... I am overwhelmed by all the help and hope to give back to the forum when I can! Ed
Create an account or sign in to comment