newbie question, wrapping text

Sadhunathan Nadesan sadhu at castandcrew.com
Wed Jan 29 07:53:01 EST 2003


Hi Jose,

Ok, many thanks.

Sadhu

| Hi Sadhu,
| 
| I understand you want to pad the text  to a fixed lenght (in fld 1 or in a
| variable) to a fld 2. Try this:
| 
| local thetext, counterr, tam
| on mouseup
|   put 0 into counterr
|   put 80 into tam
| 
|   repeat for each char x in fld 1
|     add 1 to counterr
|     if x=cr then  ---you have to control if the char is a return
|       put cr after thetext
|       put 0 into counterr
|     else
|       put x after thetext
|     end if
| 
|     if counterr=tam then
|       put 0 into counterr
|       put cr after thetext
|     end if
|   end repeat
| 
|   put thetext into fld 2
| end mouseup
| 
| Sure the script may be tunned, but even in this form it is very fast for
| small texts (some thousands of chars).
| 
| Regards,
| 
| Jose L. Rodriguez



More information about the metacard mailing list