PPWIZARD is a free preprocessor for HTML, REXX, Visual Basic or any text files.
[Bottom][Contents][Search][Prev]: BeepsAllow()[Next]: BulkChar2String()
\ -> Rexx -> Inbuilt PPWIZARD Functions -> BreakAt()

BreakAt()

This is an inbuilt function function provided by PPWIZARD.

This function gets passed a string and ensures that no component is larger than a value you specify. It is useful for automatically breaking up long URLs in tables etc so a column does not get too wide. You should also have a look at the "Wbr()" call.

The function takes the following parameters:

  1. Break Length
    There are 2 formats for this value:

  2. String
    This is the string we are adjusting.

  3. Break At Char List
    This is a list of chars. We will try and find the longest string less than or equal to "Break Length" that breaks after one of these specified characters, if we can't find one the string is just truncated at the maximum length. If this optional value is not specified then the 4 characters ":./#" are used.

  4. Break With Character
    This specifies the string used to break the string. If this optional value is not specified then "<BR>" is used.

The resultant string is returned.

EXAMPLE

This example shows a table where the first column contains a URL as a hypertext link to the URL shown. We don't wish the column to be wider than 18 characters (longer URLs will span multiple lines).

;--- Define a macro to (1) Create link (2) split up long URLS ---
#define LinkToDisplayedURL                             \
        #evaluate "TmpResult" @BreakAt(18, '{$URL}')@  \
        <A TARGET=_top HREF="http://{$URL}">           \
        <$TmpResult></A>                               \
        #undef     TmpResult

;--- Example of use in a table ----------------------------------
<BR><CENTER><TABLE COLS=2 BORDER=5 CELLSPACING=5>
    ;------------------------------------------------------------
    <TR>
    <TH ALIGN=CENTER>http://
    <TH ALIGN=CENTER>Information</B>
    </TR>

    ;------------------------------------------------------------
    <TR>
    <TD ALIGN=CENTER><$LinkToDisplayedURL URL="www.geocities.com/SiliconValley/Heights/6121/">
    <TD ALIGN=CENTER>
    Programmer's Info Page.
    </TR>
</TABLE></CENTER>


email me  any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Search][Prev]: BeepsAllow()[Next]: BulkChar2String()


PPWIZARD Manual
My whole website and this manual itself was developed using PPWIZARD (free preprocessor written by Dennis Bareis)
Sunday November 05 2017 at 10:00am