Jump to content

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

Recommended Posts

  • Newbies
Posted

I have a field that contains text like 1.11/1.55, 1.66/.66, .66/.22, etc.. I need to put everything after the "/" in another field. Is there a way to do that? It's in a FM4.x db but I could put it in FM5.x if necessary. Thanks

Posted


Set Error Capture [On]

Loop

Set Field [ newfield, Right( textfield, Length(textfield) - Position( textfield, "/", 1, 1 ) ]

If [status(CurrentError)]

{what you want to happen if the record is in use}

End If

Go to Record/Request/Page [Exit after last, Next]

End Loop

I believe the script steps and function commands should be the same in 4.

Posted

I should add an Else to the If step


Else

  Set Field [ textfield, Left( textfield, Position( textfield, "/", 1, 1 ) - 1 ) ]

End If

This will remove the / and following text from the original field, if the first Set Field was successful.

Posted

Haven't been in FM4 in a very long time, but in 5 or 6 it should be something like this:

Right(FieldName, Length(FieldName) - Position(FieldName, "/", 1, 1))

Phil

This topic is 7494 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.