Jump to content
Server Maintenance This Week. ×

quote text qestion


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

Recommended Posts

  • 2 weeks later...

You could probably process text from one field into another. Create a looping script that grabs the first say 8 words from the source field using the LeftWords() function, adds the formatting, puts the result in the destination field, then deletes these from the source field. This loop could be put inside another loop to to process through a set of records. -bd

Link to comment
Share on other sites

  • 3 weeks later...

I hate looping scripts that do stuff like this. Very inefficient.

I reckin it could be done by a calculation but the algorithm is pretty funky. I just started thinking about it.

Lets assume we break the text at 72 characters...

1) check that text string is longer than 72 characters. If it is...

2) look at the first 72 characters, check for space character. If none, insert break at character 73. If there is more than one space...

3) locate the rightmost space character within the block and insert a break to the right of it.

4) Locate the position of the first break in the string and check if there are more than 72 characters after is. If there are...

5) Check for space character. If none, insert break at character 73. If there is more than one space...

... and so on for as much text as the field holds.

As I begin to work on it, this quoting of text is a task that looks real easy but is a bugger to implement! It could be done by a calculation but it would require hard-coding in a limit to the size of the text string that can be procesed.

Of course if we simplified it by just inserting a break at the 72nd character if it happens to be a space, otherwise insert a hyphen and break then it'd be a whole lot easier. Not as pretty though.

Link to comment
Share on other sites

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