<snip>
> I have a multi-value field within a multi-value field (sub-values).
> The length of each sub-value can be up to 70 characters.  I need 
> to reformat and print the value so that each sub-value is no longer
> than 55 characters.  To complicate matters I need to know ahead of 
> time how many "lines" the reformatted value takes up so that if it's 
> greater than the page length I can do a page eject and new headings
> before I print the value.  I've never do this before so how should I
> approach this?
<snip> 

There is a little used "@" variable (in UD at least) that may help.  It's the 
"@TM" variable.

Format the string first:  STRING = FMT(STRING,"55T")
This forces the string to be at least 55 chars long, but doesn't truncate any 
word.  DCOUNT the @TM to get the number or lines.

ex.
001: STRING = 'The quick brown fox jumped over the slow lazy dog.'
002: NEW.STRING = FMT(STRING,'15T')
003: CONVERT @TM TO @SM IN NEW.STRING
004: CRT NEW.STRING
005: NEW.STRING = FMT(STRING,'40T')
006: CONVERT @TM TO @SM IN NEW.STRING
007: CRT NEW.STRING
Bottom.
*--: FIBR
Filed "STRING" in file "BP" unchanged.
                                                                  
Compiling Unibasic: /XXXXXX/XXXXX/BP/STRING in mode 'u'.
compilation finished

The quick|brown fox|jumped over|the slow lazy|dog.
The quick brown fox jumped over the|slow lazy dog.

Notice the placement of the subvalue marks.

___________________________________

Mark Olarte / System Support Manager
Puget Sound Truck Lines
206 / 654.7341
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to