Solved

Posted in wrong position

Posted on 2004-04-21
3
152 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
  • 2
3 Comments
 
LVL 18

Accepted Solution

by:
Plucka earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Disreguard last post I got it. thanks for your help.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now