Solved

Posted in wrong position

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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

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…
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.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

763 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