Solved

Posted in wrong position

Posted on 2004-04-21
3
156 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
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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Redirect website ! 4 54
how to setup ssl access to internal local machine 4 120
.htaccess rewrite url with querystring problem 13 102
Moving web servers into a DMZ? 3 67
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…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

829 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