PPWIZARD is a free preprocessor for HTML, REXX, Visual Basic or any text files.
[Bottom][Contents][Search][Prev]: BaseDate()[Next]: BulkChar2String()

BreakAt()

This is a rexx function provided by PPWIZARD. This routine (like all PPWIZARD extensions) can be used with any operating system supported 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. 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>
    


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

PPWIZARD Manual
My whole website and this manual itself was developed using PPWIZARD (free preprocessor written by Dennis Bareis)
Thursday January 17 2002 at 6:27pm