Jump to content

Remove first line of text from field


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

Recommended Posts

is there a way setup a button to delete the first line of text in a field?

I have a field on my layout that I parse address info from into the corresponding fields in my database.

after I parse the text I'd like to click a button and delete the line of text from my copypaste field I just want to remove the first line of text without having to manually highlight the text then delete it. I'ts actually going to be removing the top 6-10 lines but I figure I can have it repeate or just press the button a couple times if I need to remove more than one line.

I tried a Trim function and replace but the text varies each time so it's not always a set number of characters

Thanks

Thomas

Link to comment
Share on other sites

If there is a carriage return between your lines of text, than you could use:

Set Field [ YourTable::YourField ;

Let([

t = YourTable::YourField ;

c = ValueCount ( t ) ;

v = MiddleValues ( t ; 2 ; c - 1 )

];

Left ( v ; Length ( v ) - 1 )

)

]

Link to comment
Share on other sites

If there is a carriage return between your lines of text, than you could use:

Set Field [ YourTable::YourField ;

Let([

t = YourTable::YourField ;

c = ValueCount ( t ) ;

v = MiddleValues ( t ; 2 ; c - 1 )

];

Left ( v ; Length ( v ) - 1 )

)

]

that worked exactly the way I wanted it too THANK YOU VERY MUCH

Thomas

Link to comment
Share on other sites

  • 4 years later...
  • Newbies

I copied this and was creating the script, but when I included exactly what is shown here I get told I ned an equal sign! In the silly way FM gives the advice, it doesn't say where! What needs to be added, please?

 

Link to comment
Share on other sites

I copied this and was creating the script, but when I included exactly what is shown here

The calculation is correct. You are aware that in Set Field[], this

YourTable::YourField

is the field to be selected, and that

Let ( [ 
  t = YourTable::YourField ;
  c = ValueCount ( t ) ;
  v = MiddleValues ( t ; 2 ; c - 1 )
  ] ;
  Left ( v ; Length ( v ) - 1 )
)

is the result calculation to be specified?

btw, you can also try

Let ( 
  t = YourTable::yourField ; 
  Replace ( t ; 1 ; Position ( t ; ¶ ; 1 ; 1 ) ; "" )
)

 

Link to comment
Share on other sites

This topic is 2681 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
 Share

×
×
  • Create New...

Important Information

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