shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Mon Jun 24, 2019 4:16 am |
I have something similar already coded:
It is currently set to a 79 char limit, but that should be easily edited.
Code: |
#PRINT Text to be edited:
#PRINT %clip
#PRINT Reformatting too:
$that=%replace( %clip, %cr, " ")
#PRINT $that
#LOCAL $this $maybe $leftover $pos
#LOOP ((%len($that)/80)+2) {
#IF (%len( $that)<80) {
#ADDITEM $this %trim( $that)
$that=""
} {
$pos=0
#WHILE ($pos<80) {
$maybe=%left( $that, $pos)
$leftover=%right( $that, $pos)
$pos=($pos+%pos( " ", $leftover))
}
#ADDITEM $this %trim( %left( $that, %len( $maybe)))
$that=%right( $that, %len( $maybe))
}
}
#PRINT And here is the finished result:
#CALL %clip( %expandlist( $this, %cr))
#PRINT %clip |
|
|