Jump to content
Server Maintenance This Week. ×

Transport text surplus to another field


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

Recommended Posts

I have a text field that holds a text of, let's say,17 lines long.

When it has more then 10 lines of text, the surplus of that text has to go to another textfield. So I have textfield A that is 10 lines long (holding 10 lines of text) and a textfield B that is also 10 lines long, but holding 7 lines of text.

Regardless of the length of a text line. So I don't have 17 Carriage Returns to identify a line. Just 17 lines of text that could have only 3 Carriage Returns. 

How can you do this?

 

Appreciate your answer in advance.

 

Wilfred

(I have FMpro 12 on Mac)

Link to comment
Share on other sites

aren't the object anchoring options on the layout an option in this case?  That way you can make the text object grow when the user makes the window bigger, to display more text.

 

If not then you would probably need to work with the OnSave field trigger.  Or perhaps the OnEvaluate.  Capturing what fits and what does not fit in the text box can be very tricky.  It is going to be a combination of length and counting the # of returns.  Keep in mind though that what can be displayed in the text box depends on the font and the font size.  So if the user pasts in text in different fonts and different sizes; you will not be able to come up with a calc to cater for all of those.

You could choose to strip out all text formatting so that you are always sure what you are working with.

Link to comment
Share on other sites

Thanks for your fast reply.

But I don't want to display more text.

But it is more that I want to have something like two text columns on a page.

If the left one is full the one next to it will be filled with the remainder text. Like you have for instance in PageMaker and other DTP programms.

But I understand that this is rather difficult.

 

PS

There wil only be one font and size.

Link to comment
Share on other sites

What is the reason for wanting this, Wilfred? Will User be typing in the field and then when they soft-return to the next ( 11th ) line it takes them to Field B? Or is this for presentation only and if so, what type of display ( PDF, print, export, preview, etc ). :-)

Link to comment
Share on other sites

Printing in columns won't do the trick.

I have a picture on the left of the page and next to it are two text columns A and B.

All the input is in text column A.

 

My thought is that if I can replace the soft carriage returns in column A with hard ones; I can make text column B a calculation field that will hold all the text after hard return number 10.

But I don't know the character number of soft returns and I am not even sure if FM uses a soft return when it breaks the sentence to a next line.

 

(I have a zipped file but I do not see an attach file button; so i just dragged it in,, but I am pretty sure it can be that simple) file://localhost/Users/nlcnorthernlightcodesign/Desktop/example.zip

Link to comment
Share on other sites

The link you provided will not work. Lee can explain how to get it attached - he has it down to a science and this website does not make it intuitive - the last step should attach the file when you select it but you have to THEN also again say to upload.

Link to comment
Share on other sites

(I have a zipped file but I do not see an attach file button; so i just dragged it in,, but I am pretty sure it can be that simple) file://localhost/Users/nlcnorthernlightcodesign/Desktop/example.zip

In order to post an attachment, you have to use the "More Reply Options", not just add a reply below.

 

The steps are as follows:

Zip your file that will be attached. It can be a single file or a folder of files.

Use the More Reply Options button

Use the "Choose File" button

Select the file from your Hard Disk. The name of the file should be seen next to that button.

Use the "Attach This File" button

 

Add your remarks in the body, and then

use the "Add Reply" button.

  • Like 1
Link to comment
Share on other sites

Is there any way to pin this somewhere for easy reference, Lee? With me bouncing between platforms and mobile, I haven't coordinated how to access all my bookmarks from everywhere yet. Your explanation is very helpful. :-)

Link to comment
Share on other sites

Thank you, Lee!  And thank you Stephen for making it stickie!

 

Hi Wilfred,

 

Here is one way.  Actually, I am going to regroup.  I just thought of something else.

Link to comment
Share on other sites

Great.

 

I want to create a brochure with on the left a picture of the product and on the right a description.

 

The text column is a calculation field composed of different fields. (The green texts indicates the different fields.)

Reason behind that is I want to be able to 'compose' the content of the text. I can now choose which fields I want to appear in the text column.

 

Because the length of the content of the different fields can vary I sometimes need the extra column (B) too show text.

 

 

I hope this makes any sense to you.

 

PS

I appreciate all the effort of everybody.

 

example.zip

Link to comment
Share on other sites

Hi Lee,

The ItemsOverflow is exactly the approach i want to have.

But not every sentence end with a hard return.

So I was thinking if I can replace the soft returns (that determines if a word goes to the next line) with a hard return, I have control over the number of lines that can be in the field.

I know that a field can contain for instance 10 lines.

 

But I do not know how to make a calculation that recognizes soft returns and replaces them with hard ones.

This is my key question.

Link to comment
Share on other sites

So I was thinking if I can replace the soft returns (that determines if a word goes to the next line) with a hard return

 

I'm sure there are any soft returns in the text.  The text wrapping is done when the layout is rendered, it does not change the underlying data in any way - so there is nothing to find and replace.

Link to comment
Share on other sites

Hello there Wilfred,

 

Here are three ways to pull it off, 1) via layout trickery, 2) by script or 3) by custom function.  First two are kludges and the cf doesn't like carriage returns yet.

 

Number of characters wide must be manually determined according to the field width with the existing non-proportional font.  There is no reason this cf couldn't adjust to address field-size increase from anchors as well - we have the tools now.  I'll see what I can come up with as soon as I get some time otherwise others may have already done something similar.

SoftLinesScript.zip

Edited by LaRetta
Link to comment
Share on other sites

I replaced the file by adding the custom function as another alternative (the green fields to the right).  It can get off-track sometimes if there are hard returns - will not have time to review it for another few days probably..  But it will be better much than the script.

Link to comment
Share on other sites

  • 3 weeks later...

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