Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LOOP FROM "Home Talks" NODATERANGE SORTBY "Last Given"
- SHORTDATE_FIELD "Last Given"
- TAB =6>
- FIELD "Talk Number"
- TAB =10>
- // Let us say that we want to show the theme here, wrapped to 35 characters, at tab stop 10.
- // The first thing we do is save the talk theme to a variable
- VARIABLE_FIELD "Talk Number" "$strTalkTheme#TALK_THEME"
- // Make a copy of the talk theme variable
- $strThemeCopy = $strTalkTheme
- // How many rows do we need, if we were to wrap at 35 characters (approx)?
- $iNumTitleRows = ceil(len($strThemeCopy) / 35)
- // Loop the required number of rows
- LOOP AS $iTitleRowNum FROM 1 TO $iNumTitleRows
- // Set the tab stop
- TAB =10>
- // Find the last space prior to the exact split.
- $iLastSpace = prev_space($strThemeCopy, 35)
- // Are we on the last row of the title?
- IF "$iTitleRowNum" IS "$iNumTitleRows"
- // For the last row, must use all that is left.
- $iLastSpace = len($strThemeCopy)
- END_IF
- // This may be a few characters under; subsequent lines will be over.
- TEXT "{left($strThemeCopy, $iLastSpace) }"
- // If this is the first row of the title, then we want to display any other fields now
- IF "$iTitleRowNum" IS "1"
- TAB =25>
- FIELD "Speaker"
- END_IF
- EOL
- // Update our temporary theme variable
- $strThemeCopy = trim(mid($strThemeCopy, $iLastSpace) )
- END_LOOP
- EOL
- BLANK *1
- END_LOOP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement