Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Posted in wrong position

Posted on 2004-04-21
3
Medium Priority
?
164 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 2000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

971 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