Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 6499 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

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

  • Newbies
Posted

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

Posted

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...

Posted

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:

  • Newbies
Posted

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

This topic is 6499 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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