Solved

Posted in wrong position

Posted on 2004-04-21
3
161 Views
Last Modified: 2013-12-24
anyone here would like to join in, since I meant to post it here.

http://www.experts-exchange.com/Web/WebDevSoftware/Q_20961009.html
0
Comment
Question by:jriver12
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 18

Accepted Solution

by:
Plucka earned 500 total points
ID: 10884163
Hi jriver12,

Here's an example on your data, just loop around the string while it's greater than 49 characters and pull apart the bits. If you need any of this explained let me know.

<cfset test="acme manufacturing corporation of north and south america the quick brown fox jumps over the lazy dog">

<cfloop condition="len(test) gt 49">
     <cfset current = left(test, 49)>
     <cfset pos = len(current) - find(" ", reverse(current))>
     <cfset current = left(test, pos)>
     <cfset test = mid(test, pos+1, 999)>
     <cfoutput>#current#<br></cfoutput>
</cfloop>

<cfset current = test>
<cfoutput>#current#<br></cfoutput>

Outputs

acme manufacturing corporation of north and
south america the quick brown fox jumps over
the lazy dog

And here it is with your Zebra codes.

<cfset test="acme manufacturing corporation of north and south america the quick brown fox jumps over the lazy dog">
<cfset pl = 250>

<cfloop condition="len(test) gt 49">
     <cfset current = left(test, 49)>
     <cfset pos = len(current) - find(" ", reverse(current))>
     <cfset current = left(test, pos)>
     <cfset test = mid(test, pos+1, 999)>
     <cfoutput>
          ^FB750,1,0,C
          ^FO0,#pl#^A0,56,56^FD<cfoutput>#current#</cfoutput>^FS
     </cfoutput>
     <cfset pl = pl + 70>
</cfloop>

<cfset current = test>
<cfoutput>
     ^FB750,1,0,C
     ^FO0,#pl#^A0,56,56^FD<cfoutput>#current#</cfoutput>^FS<br>
</cfoutput>

Regards
Plucka
0
 

Author Comment

by:jriver12
ID: 10888679
Looks good.

I have found a problem that I have been unable to track,

although your variable "acme manufacturing corporation of north and south america the quick brown fox jumps over the lazy dog"

Breaks just great, however when a string as:

wimberly,lawson, steckel, Nelson & Schneider p.c.
comes into play.
it looks like it is jumping out of the loop after "wimberly,lawson, steckel," and does not break to the next line.

like I said it works fine however I cant see why it would jump out after on this particular string?

any suggestions?
0
 

Author Comment

by:jriver12
ID: 10892579
Disreguard last post I got it. thanks for your help.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
What You Need to Know when Searching for a Webhost Provider
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question