Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

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

Posted

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 )

)

]

Posted

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

  • 4 years later...
  • Newbies
Posted

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?

 

Posted

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 ) ; "" )
)

 

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